BotFlow
BotFlow copied to clipboard
Front-end docker failing
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
- sudo docker-compose up.
- Change any code line.
- Save it.
- 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.
The error was happening because of 2 factors:
- In the Dockerfile botflow was written as
botFlow
instead ofbotflow
.
FROM node:10-jessie-slim
RUN mkdir /botflow
WORKDIR /botflow
COPY ./app .
EXPOSE 3000
CMD ["sh", "-c", "yarn install && yarn start"]
- It was not recognizing the file
package.json
. Thus, I added the following command:
COPY /app/package.json .
Also, to optimize the Dockerfile was added the following line:
RUN yarn install # cache the command
CMD ["sh", "-c", "yarn start"]