-
Notifications
You must be signed in to change notification settings - Fork 7
/
prod-docker-compose.yaml
99 lines (94 loc) · 2.6 KB
/
prod-docker-compose.yaml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
version: "3.4"
networks:
app:
x-chart-pregenerator:
host: &chart-host ${NODE_CHART_PREGENERATOR_HOST:-chartgenerator}
port: &chart-port ${NODE_CHART_PREGENERATOR_PORT:-3000}
services:
postgresql:
image: postgres:13
ports:
- "127.0.0.1::5432"
environment:
POSTGRES_PASSWORD: trackerpassword
POSTGRES_USER: tracker
POSTGRES_DB: trackerdb
user: postgres
networks:
app:
aliases:
- db
django:
build:
context: .
dockerfile: devops/docker/ProdDjangoDockerfile
args:
NPM_VER: 9.6.7
USERID: 1234
image: quay.io/freedomofpress/pressfreedomtrackerus
depends_on:
- postgresql
working_dir: /django
volumes:
- ${HOST_STATIC_DIR:-fpf-django-media}:/django-media
- ${HOST_MEDIA_DIR:-fpf-django-static}:/django-static
environment:
DJANGO_ALLOWED_HOSTS: app localhost
DJANGO_COLLECT_STATIC: "yes"
DJANGO_CREATEDEVDATA: "${DJANGO_CREATEDEVDATA:-no}"
DJANGO_SETTINGS_MODULE: tracker.settings.production-ci
# Arbitrary key for this "prod-like" testing setup. Do not use in real life.
DJANGO_SECRET_KEY: 64a235ef65834d8b42fa2802dd4290cf61c773c3f31332039ec5c48165f744da
DJANGO_STATIC_ROOT: /django-static
DJANGO_MEDIA_ROOT: /django-media
DEPLOY_ENV: prod
DJANGO_DB_PASSWORD: trackerpassword
DJANGO_DB_USER: tracker
DJANGO_DB_NAME: trackerdb
DJANGO_DB_PORT: 5432
DJANGO_DB_HOST: db
DJANGO_XMLTEST_OUTPUT: "yes"
DJANGO_APP_NAME: tracker
DJANGO_JSON_LOG: "yes"
DJANGO_WHITENOISE: "yes"
DJANGO_CHART_HOST: node-chart-pregenerator
DJANGO_CHART_PORT: *chart-port
# More fake testing keys (see above); generate your own for deployment.
RECAPTCHA_PUBLIC_KEY: 6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
RECAPTCHA_PRIVATE_KEY: 6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe
ports:
- "8000:8000"
networks:
app:
aliases:
- app
node-chart-pregenerator:
read_only: true
init: true
build:
context: .
dockerfile: devops/docker/NodeChartPregeneratorDockerfile
args:
NPM_VER: 9.6.7
USERID: 1234
environment:
DJANGO_HOST: app
PORT: *chart-port
DEPLOY_ENV: dev
ports:
- target: *chart-port
published: *chart-port
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:3000/"]
start_period: 10s
interval: 30s
timeout: 20s
retries: 4
networks:
app:
aliases:
- *chart-host
volumes:
fpf-django-static:
fpf-django-media: