File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- # Apply database migrations
4- python manage.py migrate
5-
63# Create superuser if not exists
74python manage.py createsuperauto
85
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ services:
1010 - POSTGRES_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres
1111 depends_on :
1212 - database
13+ - migrate
1314 - broker
1415 ports :
1516 - mode : ingress
@@ -22,6 +23,19 @@ services:
2223 retries : 3
2324 start_period : 20s
2425
26+ migrate :
27+ restart : no
28+ build :
29+ context : ./app
30+ dockerfile : Dockerfile
31+ environment :
32+ - SECRET_KEY
33+ - REDIS_URL=redis://broker:6379/0
34+ - POSTGRES_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres
35+ depends_on :
36+ - database
37+ command : python manage.py migrate
38+
2539 worker :
2640 restart : unless-stopped
2741 build :
@@ -37,6 +51,7 @@ services:
3751 depends_on :
3852 - database
3953 - broker
54+ - migrate
4055 command : celery -A django_celery worker --loglevel=info
4156
4257 database :
You can’t perform that action at this time.
0 commit comments