BotFlow icon indicating copy to clipboard operation
BotFlow copied to clipboard

Front-end docker failing

Open mansogf opened this issue 3 years ago • 2 comments

Describe the bug Was reported by the team that while developing the app the docker was not updating changes on the application correctly.

Steps to Reproduce

  1. sudo docker-compose up.
  2. Change any code line.
  3. Save it.
  4. Check the changes on the website (it won't update).

Expected behavior When the code is changed, it, immediately, must reflect the changes in the application.

mansogf avatar Mar 11 '21 13:03 mansogf

The error was happening because of 2 factors:

  1. In the Dockerfile botflow was written as botFlow instead of botflow.
FROM node:10-jessie-slim 

RUN mkdir /botflow
WORKDIR /botflow
COPY ./app .
EXPOSE 3000
CMD ["sh", "-c", "yarn install && yarn start"] 
  1. It was not recognizing the file package.json. Thus, I added the following command:

COPY /app/package.json .

mansogf avatar Mar 11 '21 14:03 mansogf

Also, to optimize the Dockerfile was added the following line:

RUN yarn install # cache the command
CMD ["sh", "-c", "yarn start"] 

mansogf avatar Mar 11 '21 14:03 mansogf