-
Notifications
You must be signed in to change notification settings - Fork 32
/
docker-compose.prod.yml
190 lines (189 loc) · 6.3 KB
/
docker-compose.prod.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
185
186
187
188
189
190
services:
db:
image: postgres:14.4-alpine
restart: "always"
shm_size: "128mb"
environment:
- POSTGRES_PASSWORD=${DB_PASSWORD-Postgres123}
healthcheck:
test: "pg_isready -U postgres"
volumes:
- postgres-data:/usr/share/postgres/data
redis:
image: redis:6.0.6-alpine
restart: "always"
healthcheck:
test: "redis-cli ping"
api:
image: openconceptlab/oclapi2:production
restart: "always"
ports:
- 8000:8000
depends_on:
- db
# do not depend on other services so tests and pylint uses less memory
environment:
- REDIS_HOST=${REDIS_HOST-redis}
- REDIS_PORT=${REDIS_PORT-6379}
- DB_HOST=${DB_HOST-db}
- DB_PORT=${DB_PORT-5432}
- DB_PASSWORD=${DB_PASSWORD-Postgres123}
- ES_HOSTS=${ES_HOSTS-es:9200}
- ES_SCHEME=${ES_SCHEME-http}
- ENVIRONMENT=production
- DEBUG=${DEBUG-FALSE}
- SECRET_KEY
- SENTRY_DSN_KEY
- API_SUPERUSER_PASSWORD=${API_SUPERUSER_PASSWORD-Root123}
- API_SUPERUSER_TOKEN=${API_SUPERUSER_TOKEN-891b4b17feab99f3ff7e5b5d04ccc5da7aa96da6}
- API_BASE_URL=${API_BASE_URL-http://localhost:8000}
- API_INTERNAL_BASE_URL=${API_INTERNAL_BASE_URL-http://api:8000}
- EMAIL_NOREPLY_PASSWORD
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_STORAGE_BUCKET_NAME
- AWS_REGION_NAME
- ERRBIT_URL
- ERRBIT_KEY
- AZURE_STORAGE_ACCOUNT_NAME
- AZURE_STORAGE_CONTAINER_NAME
- AZURE_STORAGE_CONNECTION_STRING
healthcheck:
test: "curl --silent --fail http://localhost:8000/version/ || exit 1"
celery:
image: openconceptlab/oclapi2:production
command: ["bash", "-c", "CELERY_WORKER_NAME=default ./start_celery_worker.sh -P prefork -Q default -c 2"]
restart: "always"
healthcheck:
test: ["CMD-SHELL", "-c", "CELERY_WORKER_NAME=default ./ping_celery_worker.sh"]
environment:
- REDIS_HOST=${REDIS_HOST-redis}
- REDIS_PORT=${REDIS_PORT-6379}
- DEBUG=${DEBUG-FALSE}
- ERRBIT_URL
- ERRBIT_KEY
celery_beat:
image: openconceptlab/oclapi2:production
command: ["bash", "-c", "./start_celery_beat.sh"]
restart: "always"
healthcheck:
test: ["CMD", "python", "manage.py", "celery_beat_healthcheck"]
interval: 1m
retries: 3
environment:
- API_HOST=${API_HOST-api}
- API_PORT=${API_PORT-8000}
- DB_HOST=${DB_HOST-db}
- DB_PORT=${DB_PORT-5432}
- REDIS_HOST=${REDIS_HOST-redis}
- REDIS_PORT=${REDIS_PORT-6379}
- DEBUG=${DEBUG-FALSE}
- ERRBIT_URL
- ERRBIT_KEY
celery_indexing:
image: openconceptlab/oclapi2:production
command: ["bash", "-c", "CELERY_WORKER_NAME=indexing ./start_celery_worker.sh -P prefork -Q indexing -c 2"]
restart: "always"
healthcheck:
test: ["CMD-SHELL", "-c", "CELERY_WORKER_NAME=indexing ./ping_celery_worker.sh"]
environment:
- REDIS_HOST=${REDIS_HOST-redis}
- REDIS_PORT=${REDIS_PORT-6379}
- DEBUG=${DEBUG-FALSE}
- ERRBIT_URL
- ERRBIT_KEY
celery_concurrent:
image: openconceptlab/oclapi2:production
command: ["bash", "-c", "CELERY_WORKER_NAME=concurrent ./start_celery_worker.sh -P prefork -Q concurrent -c 2"]
restart: "always"
healthcheck:
test: ["CMD-SHELL", "-c", "CELERY_WORKER_NAME=concurrent ./ping_celery_worker.sh"]
environment:
- REDIS_HOST=${REDIS_HOST-redis}
- REDIS_PORT=${REDIS_PORT-6379}
- DEBUG=${DEBUG-FALSE}
- ERRBIT_URL
- ERRBIT_KEY
celery_bulk_import_0_1:
image: openconceptlab/oclapi2:production
command: ["bash", "-c", "CELERY_WORKER_NAME=bulk_import_0_1 ./start_celery_worker.sh -Q bulk_import_0,bulk_import_1 -c 1"]
restart: "always"
healthcheck:
test: ["CMD-SHELL", "-c", "CELERY_WORKER_NAME=bulk_import_0_1 ./ping_celery_worker.sh"]
environment:
- REDIS_HOST=${REDIS_HOST-redis}
- REDIS_PORT=${REDIS_PORT-6379}
- DEBUG=${DEBUG-FALSE}
- ERRBIT_URL
- ERRBIT_KEY
celery_bulk_import_2_3:
image: openconceptlab/oclapi2:production
command: ["bash", "-c", "CELERY_WORKER_NAME=bulk_import_2_3 ./start_celery_worker.sh -Q bulk_import_2,bulk_import_3 -c 1"]
restart: "always"
healthcheck:
test: ["CMD-SHELL", "-c", "CELERY_WORKER_NAME=bulk_import_2_3 ./ping_celery_worker.sh"]
environment:
- REDIS_HOST=${REDIS_HOST-redis}
- REDIS_PORT=${REDIS_PORT-6379}
- DEBUG=${DEBUG-FALSE}
- ERRBIT_URL
- ERRBIT_KEY
celery_bulk_import_root:
image: openconceptlab/oclapi2:production
command: ["bash", "-c", "CELERY_WORKER_NAME=bulk_import_root ./start_celery_worker.sh -Q bulk_import_root -c 1"]
restart: "always"
healthcheck:
test: ["CMD-SHELL", "-c", "CELERY_WORKER_NAME=bulk_import_root ./ping_celery_worker.sh"]
environment:
- REDIS_HOST=${REDIS_HOST-redis}
- REDIS_PORT=${REDIS_PORT-6379}
- DEBUG=${DEBUG-FALSE}
- ERRBIT_URL
- ERRBIT_KEY
flower:
image: openconceptlab/oclapi2:production
command: ["bash", "-c", "./start_flower.sh"]
ports:
- 5555:5555
depends_on:
- redis
environment:
- FLOWER_USER=${FLOWER_USER-root}
- FLOWER_PASSWORD=${FLOWER_PASSWORD-Root123}
- REDIS_HOST=${REDIS_HOST-redis}
- REDIS_PORT=${REDIS_PORT-6379}
restart: "always"
healthcheck:
test: "curl --silent --fail -u $${FLOWER_USER:-root}:$${FLOWER_PASSWORD:-Root123} http://localhost:5555/metrics || exit 1"
es:
image: elasticsearch:7.17.1
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1024m -Xmx1024m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- es-data:/usr/share/elasticsearch/data
restart: "always"
healthcheck:
test: "curl --silent --fail http://localhost:9200/_cluster/health || exit 1"
web:
image: openconceptlab/oclweb2:production
ports:
- "4000:4000"
restart: "always"
environment:
- API_URL=${API_BASE_URL-http://localhost:8000}
- NODE_ENV=${NODE_ENV-production}
- WEB_PORT=4000
- RECAPTCHA_SITE_KEY=${RECAPTCHA_SITE_KEY-6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI}
- GA_ACCOUNT_ID=${GA_ACCOUNT_ID-UA-000000-01}
- ERRBIT_URL
- ERRBIT_KEY
- HOTJAR_ID
volumes:
postgres-data:
es-data: