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 1
1
#! /bin/bash
2
2
3
- # Apply database migrations
4
- python manage.py migrate
5
-
6
3
# Create superuser if not exists
7
4
python manage.py createsuperauto
8
5
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ services:
10
10
- POSTGRES_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres
11
11
depends_on :
12
12
- database
13
+ - migrate
13
14
- broker
14
15
ports :
15
16
- mode : ingress
@@ -22,6 +23,19 @@ services:
22
23
retries : 3
23
24
start_period : 20s
24
25
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
+
25
39
worker :
26
40
restart : unless-stopped
27
41
build :
@@ -37,6 +51,7 @@ services:
37
51
depends_on :
38
52
- database
39
53
- broker
54
+ - migrate
40
55
command : celery -A django_celery worker --loglevel=info
41
56
42
57
database :
You can’t perform that action at this time.
0 commit comments