forked from ICIJ/prophecies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
65 lines (59 loc) · 1.61 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
version: '3'
volumes:
shared_static: {}
postgresql_data: {}
services:
nginx:
image: nginx:latest
ports:
- "9999:9999"
volumes:
- ./bin/nginx.conf:/etc/nginx/conf.d/default.conf
- shared_static:/static/:ro
depends_on:
- web
web:
build: .
environment:
- ALLOWED_HOSTS=0.0.0.0,localhost,web
- CSRF_TRUSTED_ORIGINS=http://localhost:9999
- DATABASE_URL=postgres://postgres:postgres@db/prophecies
- DEBUG=false
- DJANGO_SETTINGS_MODULE=prophecies.settings.production
- DJANGO_ADMIN_LOGIN=true
- PROPHECIES_APP_LOGIN_URL=/admin/login/?next=/
- PORT=8008
- WAIT_HOSTS_TIMEOUT=60
- WAIT_HOSTS=db:5432
volumes:
- shared_static:/code/prophecies/run/static
depends_on:
- db
- migration
- collectstatic
expose:
- "8008"
migration:
build: .
command: sh -c '/usr/bin/wait && poetry run python manage.py migrate --noinput'
environment:
- WAIT_HOSTS=db:5432
- WAIT_HOSTS_TIMEOUT=60
- DATABASE_URL=postgres://postgres:postgres@db/prophecies
depends_on:
- db
collectstatic:
build: .
command: poetry run python manage.py collectstatic --noinput
volumes:
- shared_static:/code/prophecies/run/static
db:
image: postgres:16
restart: always
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: prophecies
command: postgres -c shared_preload_libraries=pg_stat_statements -c 'pg_stat_statements.track=all'
volumes:
- postgresql_data:/var/lib/postgresql/data