-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
production migrate command #22
Comments
You would at least need to get Postgres up before running the migrations if you handle it that way. |
With the links in compose it will start the postgres container when you run the web container to do the migrate. If you don't do the migrate first AND there are new migrations it might error on startup until you run migrate. For example if you have pulled new migrations down from in a team. |
Your suggestion is to remove the links and then run the commands in this order? @oppianmatt
|
no keep the links but do the run migrate first. It will start up postgres as needed and apply any migrations that might be in the source and not in the db. |
I believe Docker is removing links altogether in the next release. May be worth removing them now. Also the DB would have to be up, so the commands would need to be: $ docker-compose -f production.yml build
$ docker-compose -f production.yml up postgres -d
$ docker-compose -f production.yml run web python -u manage.py migrate
$ docker-compose -f production.yml up -d |
Where did you see docker-compose is removing links? docker is removing legacy container links https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/ I believe links are still there, just now with the network. On the docker-compose links reference page:
So links is still used, and used to determine startup order. So if web links to postgres then running web will also start postgres first.
Note if postgres is restart always, it will be started anyway. For windows/mac users the migrate command needs to be:
|
In your guide you have:
But shouldn't that be?
Needs to specify the file each time. And migrate should run before up incase there are migrations to run.
The text was updated successfully, but these errors were encountered: