-
Notifications
You must be signed in to change notification settings - Fork 42
/
docker-compose.yml
143 lines (138 loc) · 4.55 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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
services:
cache:
image: redis:7-alpine
networks:
- cache
restart: unless-stopped
volumes:
- redis:/data
db:
# See also: https://www.postgresql.org/support/versioning/
# https://www.postgresql.org/developer/roadmap/
image: postgres:16-alpine
environment:
POSTGRES_DB:
POSTGRES_DB_FILE:
POSTGRES_PASSWORD:
POSTGRES_PASSWORD_FILE:
POSTGRES_USER:
POSTGRES_USER_FILE:
networks:
- database
restart: unless-stopped
volumes:
- pgdata_16:/var/lib/postgresql/data
backend:
image: mathiasertl/django-ca:${DJANGO_CA_VERSION:-latest}
command: ./celery.sh -l ${CELERY_LOG_LEVEL:-warning}
depends_on:
- cache
- db
networks:
- cache
- database
- public
volumes:
- backend_ca_dir:/var/lib/django-ca/certs/
- shared_ca_dir:/var/lib/django-ca/certs/ca/shared/
- ocsp_key_dir:/var/lib/django-ca/certs/ocsp/
environment:
DJANGO_CA_ALLOWED_HOSTS:
DJANGO_CA_CA_DEFAULT_CA:
DJANGO_CA_CA_DEFAULT_HOSTNAME:
DJANGO_CA_CA_ENABLE_ACME:
DJANGO_CA_CA_ENABLE_REST_API:
DJANGO_CA_CA_URL_PATH: ${DJANGO_CA_CA_URL_PATH-django_ca/}
DJANGO_CA_SECRET_KEY:
DJANGO_CA_SECRET_KEY_FILE: ${DJANGO_CA_SECRET_KEY_FILE:-/var/lib/django-ca/certs/ca/shared/secret_key}
DJANGO_CA_SETTINGS: ${DJANGO_CA_SETTINGS:-conf/:conf/compose}
POSTGRES_DB:
POSTGRES_DB_FILE:
POSTGRES_PASSWORD:
POSTGRES_PASSWORD_FILE:
POSTGRES_USER:
POSTGRES_USER_FILE:
WAIT_FOR_CONNECTIONS: 'db:5432'
restart: unless-stopped
stop_grace_period: 30s
frontend:
image: mathiasertl/django-ca:${DJANGO_CA_VERSION:-latest}
depends_on:
- cache
- db
networks:
- cache
- database
- frontend
volumes:
- static:/usr/share/django-ca/static/
- frontend_ca_dir:/var/lib/django-ca/certs/
- shared_ca_dir:/var/lib/django-ca/certs/ca/shared/
- ocsp_key_dir:/var/lib/django-ca/certs/ocsp/
- nginx_templates:/var/lib/django-ca/nginx/templates/
environment:
DJANGO_CA_ALLOWED_HOSTS:
DJANGO_CA_CA_DEFAULT_CA:
DJANGO_CA_CA_DEFAULT_HOSTNAME:
DJANGO_CA_CA_ENABLE_ACME:
DJANGO_CA_CA_ENABLE_REST_API:
DJANGO_CA_CA_URL_PATH: ${DJANGO_CA_CA_URL_PATH-django_ca/}
DJANGO_CA_SECRET_KEY:
DJANGO_CA_SECRET_KEY_FILE: ${DJANGO_CA_SECRET_KEY_FILE:-/var/lib/django-ca/certs/ca/shared/secret_key}
DJANGO_CA_SETTINGS: ${DJANGO_CA_SETTINGS:-conf/:conf/compose}
# Instruct the startup script to copy nginx configuration template
NGINX_TEMPLATE: ${NGINX_TEMPLATE:-default}
POSTGRES_DB:
POSTGRES_DB_FILE:
POSTGRES_PASSWORD:
POSTGRES_PASSWORD_FILE:
POSTGRES_USER:
POSTGRES_USER_FILE:
WAIT_FOR_CONNECTIONS: 'db:5432'
restart: unless-stopped
healthcheck:
test: ["CMD", "/usr/src/django-ca/ca/uwsgi-health.py"]
timeout: 3s
start_period: 25s
interval: 10s
stop_signal: SIGINT
webserver:
# available images: https://hub.docker.com/_/nginx
# table of versions: http://nginx.org/en/download.html
image: nginx:1.26-alpine
depends_on:
frontend:
condition: service_healthy
environment:
NGINX_HOST: ${DJANGO_CA_CA_DEFAULT_HOSTNAME:-localhost}
NGINX_PORT: ${NGINX_PORT:-80}
NGINX_HTTPS_PORT: ${NGINX_HTTPS_PORT:-443}
NGINX_PRIVATE_KEY:
NGINX_PUBLIC_KEY:
DJANGO_CA_CA_URL_PATH: ${DJANGO_CA_CA_URL_PATH-django_ca/}
ports:
- 80:80
networks:
- frontend
- public
volumes:
- nginx_templates:/etc/nginx/templates/
- static:/usr/share/nginx/html/static/
volumes:
shared:
static:
backend_ca_dir:
frontend_ca_dir:
shared_ca_dir:
ocsp_key_dir:
nginx_templates:
pgdata_16:
redis:
networks:
public:
frontend:
internal: true
cache:
internal: true
database:
internal: true