forked from buildingSMART/validate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.full.yml
184 lines (175 loc) · 6.36 KB
/
docker-compose.full.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
services:
# Frontend - React + nginx + Certbot
frontend:
image: buildingsmart/validationsvc-frontend
build:
context: .
dockerfile: ./docker/frontend/Dockerfile
target: run
restart: unless-stopped
container_name: frontend
ports:
- 80:80
- 443:443
environment:
CERTBOT_DOMAIN: ${CERTBOT_DOMAIN}
CERTBOT_EMAIL: ${CERTBOT_EMAIL}
volumes:
- ./docker/frontend/letsencrypt:/etc/letsencrypt
- static_data:/app/backend/django_static
depends_on:
- backend
# Backend - Django (x2)
backend:
image: buildingsmart/validationsvc-backend
build:
context: .
dockerfile: ./docker/backend/Dockerfile
target: run
entrypoint: /app/backend/server-entrypoint.sh
restart: unless-stopped
volumes:
- static_data:/app/backend/django_static
- files_data:/files_storage
expose:
- 8000
environment:
PUBLIC_URL: ${PUBLIC_URL} # for IAM links
ENV: ${ENV}
DEBUG: ${DEBUG}
CELERY_BROKER_URL: ${CELERY_BROKER_URL}
CELERY_RESULT_BACKEND: "django-db"
CELERY_RESULT_BACKEND_DB: "db+postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db/${POSTGRES_NAME}"
DJANGO_DB: ${DJANGO_DB}
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY}
DJANGO_ALLOWED_HOSTS: ${DJANGO_ALLOWED_HOSTS}
DJANGO_TRUSTED_ORIGINS: ${DJANGO_TRUSTED_ORIGINS}
DJANGO_GUNICORN_WORKERS: ${DJANGO_GUNICORN_WORKERS}
DJANGO_GUNICORN_THREADS_PER_WORKER: ${DJANGO_GUNICORN_THREADS_PER_WORKER}
POSTGRES_HOST: ${POSTGRES_HOST}
POSTGRES_PORT: ${POSTGRES_PORT}
POSTGRES_NAME: ${POSTGRES_NAME}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
B2C_CLIENT_ID: ${B2C_CLIENT_ID}
B2C_CLIENT_SECRET: ${B2C_CLIENT_SECRET}
B2C_AUTHORITY: ${B2C_AUTHORITY}
B2C_USER_FLOW: ${B2C_USER_FLOW}
USE_WHITELIST: ${USE_WHITELIST}
deploy: # example only
mode: replicated
replicas: 2
endpoint_mode: vip
depends_on:
- db
- redis
# Worker - Celery worker + beat (x2)
worker:
image: buildingsmart/validationsvc-backend
entrypoint: /app/backend/worker-entrypoint.sh
restart: unless-stopped
volumes:
- files_data:/files_storage
environment:
PUBLIC_URL: ${PUBLIC_URL} # for email links
ENV: ${ENV}
DEBUG: ${DEBUG}
CELERY_BROKER_URL: ${CELERY_BROKER_URL}
CELERY_RESULT_BACKEND: "django-db"
CELERY_RESULT_BACKEND_DB: "db+postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db/${POSTGRES_NAME}"
CELERY_TASK_SOFT_TIME_LIMIT: ${CELERY_TASK_SOFT_TIME_LIMIT}
CELERY_TASK_TIME_LIMIT: ${CELERY_TASK_TIME_LIMIT}
TASK_TIMEOUT_LIMIT: ${TASK_TIMEOUT_LIMIT}
CELERY_CONCURRENCY: ${CELERY_CONCURRENCY}
DJANGO_DB: ${DJANGO_DB}
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY}
POSTGRES_HOST: ${POSTGRES_HOST}
POSTGRES_PORT: ${POSTGRES_PORT}
POSTGRES_NAME: ${POSTGRES_NAME}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
MAILGUN_API_URL: ${MAILGUN_API_URL}
MAILGUN_API_KEY: ${MAILGUN_API_KEY}
MAILGUN_FROM_NAME: ${MAILGUN_FROM_NAME}
MAILGUN_FROM_EMAIL: ${MAILGUN_FROM_EMAIL}
ADMIN_EMAIL: ${ADMIN_EMAIL}
CONTACT_EMAIL: ${CONTACT_EMAIL}
deploy: # example only
mode: replicated
replicas: 2
endpoint_mode: vip
depends_on:
- db
- redis
# Redis
redis:
image: redis:7.2-alpine
restart: unless-stopped
container_name: redis
expose:
- ${REDIS_PORT}
volumes:
- redis_data:/data
# PostgreSQL DB
db:
image: postgres:16.2-alpine
restart: unless-stopped
container_name: db
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
POSTGRES_DB: ${POSTGRES_NAME}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
expose:
- ${POSTGRES_PORT}
# Prometheus
prometheus:
image: prom/prometheus:v2.50.1
restart: unless-stopped
container_name: prometheus
command: --config.file=/etc/prometheus/prometheus.yml --no-scrape.adjust-timestamps
volumes:
- ./docker/prometheus/prometheus.yaml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
ports:
- 9090:9090
# Grafana
grafana:
image: grafana/grafana:10.4.0
restart: unless-stopped
container_name: grafana
volumes:
- ./docker/grafana/grafana.ini:/etc/grafana/grafana.ini
- ./docker/grafana/provisioning/:/etc/grafana/provisioning/
- grafana_data:/var/lib/grafana
ports:
- 3000:3000
depends_on:
- prometheus
# OpenTelemetry Collector
otel_col:
image: otel/opentelemetry-collector-contrib:0.96.0 # contrib includes eg. Redis/PostgreSQL already
restart: unless-stopped
container_name: otel_col
expose:
- 4317 # OTLP over gRPC receiver
- 4318 # OTLP over HTTP receiver
- 8888 # Prometheus metrics exposed by the collector
- 8889 # Prometheus exporter metrics
- 1888 # pprof extension
- 55679 # zpages extension
- 13133 # health_check extension
volumes:
- ./docker/otel/otel-collector-config.yaml:/etc/otel-collector-config.yaml
# no persistence by design
depends_on:
- prometheus
volumes:
static_data:
files_data:
postgres_data:
redis_data:
otel_data:
prometheus_data:
grafana_data: