-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
68 lines (65 loc) · 1.76 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
66
67
68
version: "3"
services:
db:
image: postgres:13.3
restart: unless-stopped
volumes:
- db-data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=actnow
- POSTGRES_PASSWORD=actnow
- POSTGRES_DB=actnow
ports:
# Allow DB access from outside the container
- "54321:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U actnow"]
interval: 5s
timeout: 5s
retries: 5
app:
image: codeforafrica/actnow:latest
restart: unless-stopped
build:
context: .
target: python-app-ci
volumes:
- app-staticfiles:/app/staticfiles
- app-mediafiles:/app/media
- ${APP_VOLUME:-app-files}:/app
depends_on:
- db
env_file:
- .env
environment:
- ACTNOW_ALLOWED_HOSTS=${ACTNOW_ALLOWED_HOSTS:-*}
- ACTNOW_DATABASE_URL=${ACTNOW_DATABASE_URL:-postgresql://actnow:actnow@db:5432/actnow}
- ACTNOW_DEBUG=${ACTNOW_DEBUG:-True}
- DJANGO_ENV=${DJANGO_ENV:-local}
- ACTNOW_GUNICORN_LOG_LEVEL=${ACTNOW_GUNICORN_LOG_LEVEL:-info}
- ACTNOW_GUNICORN_EXTRA_CONFIG=${ACTNOW_GUNICORN_EXTRA_CONFIG:---reload}
# psql connection parameters (used in wait-for-postgrsql.sh)
# see: https://www.postgresql.org/docs/9.6/libpq-envars.html
- PGHOST=db
- PGUSER=actnow
- PGPASSWORD=actnow
- PGDATABASE=actnow
stdin_open: true
tty: true
command: ["/wait-for-postgres.sh", "/cmd.sh"]
nginx:
image: nginx:1.20.0
restart: unless-stopped
volumes:
- ./contrib/docker-compose/nginx:/etc/nginx/conf.d
- app-staticfiles:/var/www/static
- app-mediafiles:/var/www/media
ports:
- 8000:80
depends_on:
- app
volumes:
db-data:
app-staticfiles:
app-mediafiles:
app-files: