I'm struggling to understand the sequence of commands in backend dockerfile
\nthe Dockerfile runs uvicorn main:app --reload when importing the Dockerfile from FROM tiangolo/uvicorn-gunicorn-fastapi:python3.10
\n with command CMD [\"/start.sh\"] is there!
however `COPY ./app /app/app takes place till the end here .
\nHow is unicorn being executed without the app? does this mean CMD at the end of tiangolo/uvicorn-gunicorn-fastapi:python3.10 is somehow delayed?
I see that docker-compose.override.yml has
\ncommand: /start-reload.sh
\nwhich executes uvicorn
however I can't understand how does docker-compose.yml work in production
macOS
\ndocker
\n3.9
\nNo response
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"In current implementation, there is a command defined in in .Dockerfile:
CMD [\"fastapi\", \"run\", \"--workers\", \"4\", \"app/main.py\"]`\nAnd for development, this command is overridden in docker-compose.override.yml:
backend:\n ...\n command:\n - fastapi\n - run\n - --reload\n - \"app/main.py\"\nSo, in production, the command defined in .Dockerfile is used
-
First Check
Commit to Help
Example CodeDescriptionI'm struggling to understand the sequence of commands in backend dockerfile the Dockerfile runs however `COPY ./app /app/app takes place till the end here . How is unicorn being executed without the app? does this mean CMD at the end of I see that however I can't understand how does Operating SystemmacOS Operating System Detailsdocker Python Version3.9 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
-
|
In current implementation, there is a command defined in in And for development, this command is overridden in So, in production, the command defined in |
Beta Was this translation helpful? Give feedback.
In current implementation, there is a command defined in in
.Dockerfile:And for development, this command is overridden in
docker-compose.override.yml:So, in production, the command defined in
.Dockerfileis used