-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
204 lines (191 loc) · 5.5 KB
/
Copy pathdocker-compose.yml
File metadata and controls
204 lines (191 loc) · 5.5 KB
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# DISCLAIMER: THIS IS FOR DEVELOPMENT PURPOSES ONLY AND NOT SUITABLE FOR PRODUCTION.
x-labels: &x-labels
client: dev
target: test
app: "opendms"
x-app-env: &x-app-env
- DJANGO_SETTINGS_MODULE=opendms.conf.docker
- SECRET_KEY=${SECRET_KEY:-django-insecure-kex=ipoau_q(o_w=6bd8q6_sb2#xgkdbknq4m&hl2jtx(7#n_}
- DB_NAME=opendms
- DB_USER=opendms
- DB_HOST=db
# Only allow all hosts for development/testing purposes!
- ALLOWED_HOSTS=*
- STATIC_ROOT_VOLUME=/srv/static/
- CACHE_DEFAULT=redis:6379/0
- CACHE_AXES=redis:6379/0
- CELERY_BROKER_URL=redis://redis:6379/1
- CELERY_RESULT_BACKEND=redis://redis:6379/1
- CELERY_WORKER_NAME=celery@docker
- DISABLE_2FA=true
# Environment labeling
- SHOW_ENVIRONMENT=yes
- ENVIRONMENT_LABEL=docker-compose
- ENVIRONMENT_BACKGROUND_COLOR=#1d63ed
- ENVIRONMENT_FOREGROUND_COLOR=white
# Enabling Open Telemetry requires a target to send telemetry towards!
- OTEL_SDK_DISABLED=${OTEL_SDK_DISABLED:-true}
- OTEL_RESOURCE_ATTRIBUTES=maykin.saas.client=maykin,maykin.saas.target=dev
- OTEL_METRIC_EXPORT_INTERVAL=${OTEL_METRIC_EXPORT_INTERVAL:-60000}
- OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT:-http://otel-collector:4317} # gRPC
# otel:supersecret, escape spaces and = with percent encoding
# - OTEL_EXPORTER_OTLP_HEADERS=Authorization=Basic b3RlbDpzdXBlcnNlY3JldA==
- OTEL_EXPORTER_OTLP_METRICS_INSECURE=${OTEL_EXPORTER_OTLP_METRICS_INSECURE:-true}
- _OTEL_ENABLE_CONTAINER_RESOURCE_DETECTOR=true
# ES settings
- INIT_ES_INDICES=true
- ELASTICSEARCH_HOST=http://es:9200/
- ELASTICSEARCH_USER=elastic
- ELASTICSEARCH_PASSWORD=insecure-elastic
x-app-volumes: &x-app-volumes
- static:/srv/static
- media:/app/media
services:
db:
image: postgres:${PG_VERSION:-17}
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- ./docker/init-db.sql:/docker-entrypoint-initdb.d/init_db.sql
- db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
networks:
- open-dms-dev
redis:
image: redis:8
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 1s
retries: 3
networks:
- open-dms-dev
# Based on https://www.elastic.co/guide/en/elasticsearch/reference/current/run-elasticsearch-locally.html
# Log in with `elastic` / `insecure-elastic` (or whatever you set the envvar `ES_PASSWORD` to).
es:
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_VERSION:-8.17.1}
environment:
- discovery.type=single-node
- cluster.name=opendms-dev
- node.name=es01
- node.roles=master,data,ingest
- ingest.geoip.downloader.enabled=false
- ELASTIC_PASSWORD=${ES_PASSWORD:-insecure-elastic}
- xpack.security.enabled=true
- xpack.security.http.ssl.enabled=false
# - xpack.license.self_generated.type=trial
- xpack.ml.use_auto_machine_memory_percent=true
- ES_JAVA_OPTS=-Xms${ES_HEAP_INIT:-128m} -Xmx${ES_HEAP_MAX:-2g}
- cluster.routing.allocation.disk.watermark.low=${ES_DISK_SPACE_REQUIRED:-1gb}
- cluster.routing.allocation.disk.watermark.high=${ES_DISK_SPACE_REQUIRED:-1gb}
- cluster.routing.allocation.disk.watermark.flood_stage=${ES_DISK_SPACE_REQUIRED:-1gb}
volumes:
- es-data:/usr/share/elasticsearch/data
ulimits:
memlock:
soft: -1
hard: -1
healthcheck:
test:
[
"CMD-SHELL",
"curl --output /dev/null --silent --head --fail -u elastic:${ES_PASSWORD:-insecure-elastic} http://es:9200",
]
interval: 5s
timeout: 5s
retries: 10
ports:
- 9200:9200
# - "9300:9300"
networks:
- open-dms-dev
prepare-volumes:
image: busybox
command: /bin/chown -R 1000 /srv/static
volumes:
- static:/srv/static
web:
build: .
image: maykinmedia/opendms:${TAG:-latest}
environment: *x-app-env
volumes: *x-app-volumes
healthcheck:
test: ["CMD-SHELL", "maykin-common health-check"]
interval: 30s
timeout: 5s
retries: 5
labels:
<<: *x-labels
service: web
ports:
- 8000:8000
depends_on:
- prepare-volumes
- db
- redis
- es
networks:
- open-dms-dev
celery:
image: maykinmedia/opendms:${TAG:-latest}
environment: *x-app-env
command: /celery_worker.sh
healthcheck:
test: [
"CMD",
"maykin-common",
"worker-health-check",
"--liveness-file=/app/tmp/celery_worker_event_loop.live",
"--max-age=70",
"--broker=redis://redis:6379/0",
"--worker-name=celery@docker",
]
interval: 60s
timeout: 5s
retries: 3
start_period: 10s
volumes: *x-app-volumes
depends_on:
- db
- redis
networks:
- open-dms-dev
celery-beat:
image: maykinmedia/opendms:${TAG:-latest}
environment: *x-app-env
command: /celery_beat.sh
depends_on:
- redis
- celery
networks:
- open-dms-dev
celery-flower:
image: maykinmedia/opendms:${TAG:-latest}
environment: *x-app-env
command: /celery_flower.sh
ports:
- 5555:5555
depends_on:
- redis
- celery
healthcheck:
test: [
"CMD",
"maykin-common",
"health-check",
"--endpoint=http://localhost:5555/"
]
networks:
- open-dms-dev
volumes:
db:
static:
media:
es-data:
networks:
open-dms-dev:
name: open-dms-dev