Answer the question
In order to leave comments, you need to log in
How to migrate in a dockerfile if the base is in a different container?
Hello friends!, Such a situation:
There is a container with a database and a container for a django application that links to the database and starts itself:
FROM deb_base
COPY vfnd vfnd
CMD ["python", "./vfnd/manage.py", "runserver", "0.0.0.0:8001"]
Answer the question
In order to leave comments, you need to log in
Make the dependency of this container on the database.
https://docs.docker.com/compose/compose-file/#depe...
As a result, you will first start the container with the database, then the container with your code, in which you do python /vfnd/manage migrate
everything and everything works fine
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question