You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working now to make it run on aws ecs and I have some troubles to mount volumes to containers
Why do we need to copy folders(Dockerfile) to the Image build COPY . /opt/app COPY . /opt/frontend
and also mount volumes from yml volumes: - ./frontend/.:/opt/frontend - /opt/frontend/node_modules volumes: - ./api/.:/opt/app - /opt/app/node_modules
also we copy api and all files and next api/node_modules, is it right?
For me it's looks redundant.
The text was updated successfully, but these errors were encountered:
We copy the folders because that is where the code is. For example, /api/Dockerfile copies in the contents of /api/.* and then that is what is run via node.
The docker-compose.yml is only used locally. The Dockerfile builds an image, so the files need to be inside the image. The docker-compose mounts the volumes so that our watch-scripts will detect changes and reload.
We are not copying in node_modules, though. We exclude node modules in the docker-compose.yml because the docker/run.sh file uses a yarn cache inside the container to make it so that modules are only downloaded when package.json changes
We also use the Dockerfile to build the image on the CI server, and that is why there is also a yarn command in there to install the modules
Hmmmmm maybe... /postgres-data has generally just worked for me. However, I do not rely on the postgres image but rather I use RDS and deploy my migrations as the root user
I'm working now to make it run on aws ecs and I have some troubles to mount volumes to containers
Why do we need to copy folders(Dockerfile) to the Image build
COPY . /opt/app COPY . /opt/frontend
and also mount volumes from yml
volumes: - ./frontend/.:/opt/frontend - /opt/frontend/node_modules volumes: - ./api/.:/opt/app - /opt/app/node_modules
also we copy api and all files and next api/node_modules, is it right?
For me it's looks redundant.
The text was updated successfully, but these errors were encountered: