I'm using docker-compose (on windows) to bring up a mongoDB along with a couple of nodeJS processes (on a remote CentOS machine via SSH). The nodeJS containers are supposed to have the code in my project directory mounted into /home/node/app
so they can execute it with the command node web/run
. However, when I use docker context to deploy this group of containers to my remote host via SSH, I get an error saying the script at /home/node/app/web/run
is not found, suggesting my code was not copied into/mounted into the container.
You can see that I'm mounting the current directory (my project) below:
web:
image: node:15.12.0
user: node
working_dir: /home/node/app
volumes:
- ./:/home/node/app:ro
ports:
- 80:80
command: node web/run
depends_on:
- events-db
Am I misunderstanding how volumes work in Docker? What are the best practices for getting my code into a container so it can be executed?