-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
134 lines (128 loc) · 4.66 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
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
backend:
image: buildingsmart/validationsvc-backend
build:
context: .
dockerfile: ./docker/backend/Dockerfile
target: run
entrypoint: /app/backend/server-entrypoint.sh
restart: unless-stopped
container_name: backend
volumes:
- static_data:/app/backend/django_static
- files_data:/files_storage
ports:
- 8000: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}
depends_on:
- db
- redis
# Worker - Celery worker + beat
worker:
image: buildingsmart/validationsvc-backend
build:
context: .
dockerfile: ./docker/backend/Dockerfile
target: run
entrypoint: /app/backend/worker-entrypoint.sh
restart: unless-stopped
container_name: worker
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}
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}
volumes:
static_data:
files_data:
postgres_data:
redis_data: