-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
193 lines (185 loc) · 4.84 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
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
version: "2.4"
services:
web:
image: ddionrails:latest
build:
context: https://github.com/ddionrails/ddionrails.git#master:.
dockerfile: docker/ddionrails/Dockerfile
command:
[
"gunicorn",
"config.wsgi",
"--bind",
"0.0.0.0:8000",
"--error-logfile",
"-",
"--access-logfile",
"-",
"--log-level=info",
"--access-logformat",
'[gunicorn] %(h)s %(l)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"',
]
depends_on:
postgres:
condition: service_healthy
elasticsearch:
condition: service_healthy
# Set your own variables, use of the example files at your own risk.
#env_file:
# - docker/environments/django.env
# - docker/environments/database.env
# - docker/environments/elasticsearch.env
networks:
ddi_net:
# This Address is used in the nginx.example.conf and in the docker/mail/Dockerfile
# If you want to change it, you have to also change it there.
ipv4_address: 172.16.238.10
ipv6_address: 2001:3984:3989::10
pids_limit: 100
ports:
- 8000
restart: on-failure:5
security_opt:
- no-new-privileges
volumes:
- type: volume
source: static
target: /usr/src/app/static
volume:
nocopy: false
- media:/var/django/media
# Hardcoded again in ./config/settings/base.py
- backup:/var/lib/ddionrails/backup
- statistics-data:/var/statistics_data
postgres:
image: postgres:15.9-alpine3.20
# Set your own variables, use of the example files at yout own risk.
#env_file:
# - docker/environments/database.env
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ddi_net
pids_limit: 100
security_opt:
- no-new-privileges
restart: on-failure:5
volumes:
# Config
- ddi-psql-config:/etc/postgresql
# Data
- ddi-psql-data:/var/lib/postgresql
# Logs
- ddi-psql-logs:/var/log/postgresql
elasticsearch:
image: elasticsearch:8.5.1
healthcheck:
test:
[
"CMD-SHELL",
"curl --silent --fail -u elastic:$$ELASTIC_PASSWORD localhost:9200/_cluster/health",
]
interval: 10s
timeout: 5s
retries: 5
# These settings are taken from the elastic search installation guide:
# https://www.elastic.co/guide/en/elasticsearch/reference/6.8/docker.html
# I am unclear about their necessity and function, except ES_JAVA_OPTS.
environment:
- discovery.type=single-node
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
# Sets the RAM the java VM is allowed to use
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
networks:
- ddi_net
pids_limit: 5000
restart: on-failure:5
security_opt:
- no-new-privileges
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- elastic_data:/usr/share/elasticsearch/data
- ./docker/environments/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
mail:
image: mail:latest
build:
context: https://github.com/ddionrails/ddionrails.git#master:.
dockerfile: docker/postfix/Dockerfile
networks:
- ddi_net
pids_limit: 30
restart: on-failure:5
security_opt:
- no-new-privileges
nginx:
image: nginx:1.23.2-alpine
ports:
- 80:80
depends_on:
- web
environment:
- HOST_NAME=127.0.0.1
networks:
- ddi_net
pids_limit: 100
restart: on-failure:5
security_opt:
- no-new-privileges
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
- type: volume
source: static
target: /usr/src/app/static
read_only: true
volume:
nocopy: true
- media:/var/django/media
redis:
image: redis:7.0.5-alpine3.16
networks:
- ddi_net
pids_limit: 500
restart: on-failure:5
security_opt:
- no-new-privileges
statistics-server:
image: statistics-server:dash
build: https://github.com/ddionrails/statistics-server.git#main:.
depends_on:
- web
expose:
- 8081
networks:
- ddi_net
volumes:
- statistics-data:/statistics_data
environment:
- STATISTICS_BASE_PATH=/statistics_data
- UI_TRANSLATIONS_PATH=statistics_server/ui_translations.yaml
- URL_BASE_PATHNAME=/statistics-server/
restart: on-failure:5
security_opt:
- no-new-privileges
volumes:
backup:
ddi-psql-config:
ddi-psql-data:
ddi-psql-logs:
elastic_data:
media:
static:
statistics-data:
networks:
ddi_net:
ipam:
driver: default
config:
- subnet: "172.16.238.0/24"
- subnet: "2001:3984:3989::/64"