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
Docker containers should contain as little content as possible, and when possible - not be live.
Using:
volumes:
- .:/app
Both loads the container with a lot of unnecessary files AND makes it "live", meaning that any changes in the source code automatically get applied inside the container, which is an antipattern. Containers should be self-sustaining and isolated.
Mounting source code like this should only be done for debugging.
A few required corrections:
In the Dockerfiles, use the COPY or ADD directives to copy the necessary files to the container image, as selectively as possible.
Maintain a seperate docker-compose.yaml file for debugging and for production, with only the debugging one containing the mounting.
The style container might also be redundant in such a case - just compile SASS once and avoid having to use watch (since again, that is for live debugging)
The text was updated successfully, but these errors were encountered:
Docker containers should contain as little content as possible, and when possible - not be live.
Using:
Both loads the container with a lot of unnecessary files AND makes it "live", meaning that any changes in the source code automatically get applied inside the container, which is an antipattern. Containers should be self-sustaining and isolated.
Mounting source code like this should only be done for debugging.
A few required corrections:
Dockerfile
s, use theCOPY
orADD
directives to copy the necessary files to the container image, as selectively as possible.docker-compose.yaml
file for debugging and for production, with only the debugging one containing the mounting.style
container might also be redundant in such a case - just compile SASS once and avoid having to usewatch
(since again, that is for live debugging)The text was updated successfully, but these errors were encountered: