-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
47 lines (47 loc) · 1.2 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
version: "3.9"
services:
app:
image: "movies:latest"
ports:
- "8000:8000"
command: >
bash -c "
sleep 20 &&
python manage.py runserver 0.0.0.0:8000"
environment:
- MOVIES_DATABASE_HOST=postgres
- MOVIES_DATABASE_PORT=5432
- MOVIES_DATABASE_PASSWORD=secret
- MOVIES_DATABASE_USER=movies
- MOVIES_DATABASE_NAME=movies
depends_on:
- postgres
- migrations
migrations:
image: "movies:latest"
command: >
bash -c "
sleep 20 &&
python manage.py migrate &&
python manage.py shell < viewer/db/create_superuser.py"
depends_on:
- postgres
environment:
- DJANGO_SUPERUSER_USERNAME=admin
- DJANGO_SUPERUSER_PASSWORD=admin
- MOVIES_DATABASE_HOST=postgres
- MOVIES_DATABASE_PORT=5432
- MOVIES_DATABASE_PASSWORD=secret
- MOVIES_DATABASE_USER=movies
- MOVIES_DATABASE_NAME=movies
postgres:
image: "postgres:latest"
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=secret
- POSTGRES_USER=movies
- POSTGRES_DB=movies
volumes:
- ./pgdata:/var/lib/postgresql/data