I don't know what's wrong with my docker-compose
, I'm trying to implement volume to constantly updating the app inside the container while working on it on the host with the nodemon, but it doesn't work. I have been fighting with it almost the whole day, but I can't see what is wrong.
FROM node:12.18.4
WORKDIR /usr/src/youtube-clone-app
COPY ./ ./
RUN npm install
CMD [ "npm", "start" ]
version: "3.8"
services:
youtube-clone-app:
build: ./
container_name: server
ports:
- "5000:5000"
volumes:
- ./:/usr/src/youtube-clone-app
It's a bit difficult to understand exactly what you need, but try this:
Note
CMD ["nodemon", "start"]
instead ofCMD ["npm", "start"]
. If necessary, try to replacestart
with your node app script, e.g../server.js
. Make surenodemon
is in yourpackage.json
. Additionally, add a context to yourdocker-compose
build option.