##// END OF EJS Templates
loki: temp solution to run loki locally
super-admin -
Show More
@@ -1,334 +1,336 b''
1 1 version: '3.9'
2 2
3 3 x-logging: &custom-logging
4 4 # docker plugin install grafana/loki-docker-driver:2.7.1 --alias loki --grant-all-permissions
5 5 # NOTE: loki logging driver ONLY works for host type networks...
6 6 driver: loki
7 7 options:
8 loki-url: "http://loki:3100/loki/api/v1/push"
8 #loki-url: "http://loki:3100/loki/api/v1/push"
9 loki-url: "http://127.0.0.1:3100/loki/api/v1/push"
9 10 loki-retries: "5"
10 11 loki-timeout: "1s"
11 12 loki-max-backoff: "800ms"
12 13
13 14
14 15 services:
15 16
16 17 rhodecode:
17 18 networks:
18 19 - rhodecode_network
19 20 extra_hosts:
20 21 - "host.docker.internal:host-gateway"
21 22 image: rhodecode/rhodecode-${RC_EDITION}:${RC_VERSION:-4.28.0}
22 23 stdin_open: true
23 24 tty: true
24 25 restart: always
25 26 env_file:
26 27 - ${RC_ENV_FILE:?must-specify-rc-env-file}
27 28 command: [
28 29 "/usr/local/bin/rhodecode_bin/bin/gunicorn",
29 30 "--name=gunicorn-rhodecode-1",
30 31 "--error-logfile=-",
31 32 "--paster=/etc/rhodecode/conf/rhodecode.ini",
32 33 "--config=/etc/rhodecode/conf/gunicorn_conf_rc.py"
33 34 ]
34 35 deploy:
35 36 # override this in .custom/docker-compose-apps.override.yaml to scale up
36 37 replicas: 1
37 38
38 39 # ports:
39 40 # - "127.0.0.1::10020"
40 41
41 42 build:
42 43 context: .
43 44 dockerfile: service/rhodecode/rhodecode.dockerfile
44 45 args:
45 46 TZ: ${TZ}
46 47 RHODECODE_VERSION: ${RC_VERSION:-4.28.0}
47 48 RHODECODE_DB: postgresql://rhodecode:${DB_PASSWORD:?must-specify-db-password}@database/${DB_NAME:?must-specify-db-name}
48 49 RHODECODE_USER_NAME: ${RHODECODE_USER_NAME}
49 50 RHODECODE_USER_PASS: ${RHODECODE_USER_PASS}
50 51 RHODECODE_USER_EMAIL: ${RHODECODE_USER_EMAIL}
51 52
52 53 environment:
53 54 RC_APP_TYPE: rhodecode_http
54 55 RC_APP_PROC: 1
55 56 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
56 57 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
57 58 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
58 59 GEVENT_RESOLVER: "ares"
59 60
60 61 DB_UPGRADE: 1 # run the DB upgrade
61 62 SETUP_APP: 1 # run the application default settings setup, can be turned off after initial run
62 63 #FORCE_DB_INIT_FILE: 1 # force the database init, warning: destroys old DB
63 64 #FORCE_RC_SETUP_APP: 1 # force running setup scripts for configuration/license application
64 65 MAIN_INI_PATH: /etc/rhodecode/conf/rhodecode.ini
65 66
66 67 # SVN Specific
67 68 MOD_DAV_SVN_PORT: 8090
68 69 APACHE_LOG_DIR: /var/log/rhodecode/svn
69 70 MOD_DAV_SVN_CONF_FILE: /etc/rhodecode/conf/svn/mod_dav_svn.conf
70 71
71 72 healthcheck:
72 73 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:10020/_admin/ops/ping" ]
73 74 timeout: 30s
74 75 interval: 60s
75 76 retries: 10
76 77
77 78 # depends_on:
78 79 # - database
79 80 # - redis
80 81 # - channelstream
81 82
82 83 volumes:
83 84 - confvolume:/etc/rhodecode/conf
84 85 - logvolume:/var/log/rhodecode
85 86 - rc_reposvolume:/var/opt/rhodecode_repo_store
86 87 - rc_datavolume:/var/opt/rhodecode_data
87 88
88 89 tmpfs:
89 90 - /data_ramdisk:size=${RC_DATA_RAMDISK_SIZE:?specify-RC_DATA_RAMDISK_SIZE-env-var}
90 91
91 92 logging:
92 93 *custom-logging
93 94
94 95 labels:
95 96 - "traefik.enable=true"
96 97 - "traefik.http.routers.rhodecode.entrypoints=http"
97 98 - "traefik.http.routers.rhodecode.rule=Host(`${RC_HOSTNAME:?must-specify-rhodecode-hostname}`)"
98 99 - "traefik.http.routers.rhodecode.service=rhodecode-web"
99 100 - "traefik.http.services.rhodecode-web.loadbalancer.server.port=10020"
100 101 # SSL + proxy prefix example, should be put into .custom/docker-compose-apps.override.yaml
101 102 #- "traefik.http.routers.rhodecode-rt.entrypoints=https"
102 103 #- "traefik.http.routers.rhodecode-rt.rule=Host(`${RC_HOSTNAME:?must-specify-rhodecode-hostname}`)"
103 104 #- "traefik.http.routers.rhodecode-rt.tls=true"
104 105 #- "traefik.http.routers.rhodecode-rt.service=rhodecode-ssl"
105 106 #- "traefik.http.services.rhodecode-ssl.loadbalancer.server.port=10020"
106 107
107 108 vcsserver:
108 109 networks:
109 110 - rhodecode_network
110 111 extra_hosts:
111 112 - "host.docker.internal:host-gateway"
112 113 image: rhodecode/rhodecode-${RC_EDITION}:${RC_VERSION:-4.28.0}
113 114
114 115 stdin_open: true
115 116 tty: true
116 117 restart: always
117 118 env_file:
118 119 - ${RC_ENV_FILE:?must-specify-rc-env-file}
119 120 command: [
120 121 "/home/rhodecode/.rccontrol/vcsserver-1/profile/bin/gunicorn",
121 122 "--name=gunicorn-vcsserver-1",
122 123 "--error-logfile=-",
123 124 "--paster=/etc/rhodecode/conf/vcsserver.ini",
124 125 "--config=/etc/rhodecode/conf/gunicorn_conf_vcs.py"
125 126 ]
126 127 deploy:
127 128 # override this in .custom/docker-compose-apps.override.yaml to scale up
128 129 replicas: 1
129 130
130 131 # ports:
131 132 # - "127.0.0.1::10010"
132 133
133 134 healthcheck:
134 135 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:10010/status" ]
135 136 timeout: 30s
136 137 interval: 60s
137 138 retries: 10
138 139
139 140 environment:
140 141 RC_APP_TYPE: rhodecode_vcsserver
141 142 RC_APP_PROC: 1
142 143 MAIN_INI_PATH: /etc/rhodecode/conf/vcsserver.ini
143 144 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
144 145 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
145 146 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
146 147
147 148 # depends_on:
148 149 # - redis
149 150
150 151 volumes:
151 152 - confvolume:/etc/rhodecode/conf
152 153 - logvolume:/var/log/rhodecode
153 154 - rc_reposvolume:/var/opt/rhodecode_repo_store
154 155 - rc_datavolume:/var/opt/rhodecode_data
155 156
156 157 logging:
157 158 *custom-logging
158 159
159 160 celery:
160 161 networks:
161 162 - rhodecode_network
162 163 extra_hosts:
163 164 - "host.docker.internal:host-gateway"
164 165 image: rhodecode/rhodecode-${RC_EDITION}:${RC_VERSION:-4.28.0}
165 166
166 167 stdin_open: true
167 168 tty: true
168 169 restart: always
169 170 env_file:
170 171 - ${RC_ENV_FILE:?must-specify-rc-env-file}
171 172 command: [
172 173 "/usr/local/bin/rhodecode_bin/bin/celery",
173 174 "worker",
174 175 "--task-events",
175 176 "--autoscale=10,2",
176 177 "--no-color",
177 178 "--app=rhodecode.lib.celerylib.loader",
178 179 "--loglevel=DEBUG",
179 180 "--ini=/etc/rhodecode/conf/rhodecode.ini"
180 181 ]
181 182
182 183 environment:
183 184 RC_APP_TYPE: rhodecode_celery
184 185 RC_APP_PROC: 1
185 186 MAIN_INI_PATH: /etc/rhodecode/conf/rhodecode.ini
186 187 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
187 188 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
188 189 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
189 190
190 191 # depends_on:
191 192 # - database
192 193 # - redis
193 194
194 195 volumes:
195 196 - confvolume:/etc/rhodecode/conf
196 197 - logvolume:/var/log/rhodecode
197 198 - rc_reposvolume:/var/opt/rhodecode_repo_store
198 199 - rc_datavolume:/var/opt/rhodecode_data
199 200
200 201 logging:
201 202 *custom-logging
202 203
203 204 labels:
204 205 - "traefik.enable=false"
205 206
206 207 celery-beat:
207 208 # This service is not scalable
208 209 networks:
209 210 - rhodecode_network
210 211 extra_hosts:
211 212 - "host.docker.internal:host-gateway"
212 213 image: rhodecode/rhodecode-${RC_EDITION}:${RC_VERSION:-4.28.0}
213 214
214 215 stdin_open: true
215 216 tty: true
216 217 restart: always
217 218 env_file:
218 219 - ${RC_ENV_FILE:?must-specify-rc-env-file}
219 220 command: [
220 221 "/usr/local/bin/rhodecode_bin/bin/celery",
221 222 "beat",
222 223 "--no-color",
223 224 "--app=rhodecode.lib.celerylib.loader",
224 225 "--scheduler=rhodecode.lib.celerylib.scheduler.RcScheduler",
225 226 "--loglevel=DEBUG",
226 227 "--ini=/etc/rhodecode/conf/rhodecode.ini"
227 228 ]
228 229
229 230 environment:
230 231 RC_APP_TYPE: rhodecode_beat
231 232 RC_APP_PROC: 1
232 233 MAIN_INI_PATH: /etc/rhodecode/conf/rhodecode.ini
233 234 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
234 235 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
235 236 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
236 237
237 238 # depends_on:
238 239 # - database
239 240 # - redis
240 241
241 242 volumes:
242 243 - confvolume:/etc/rhodecode/conf
243 244 - logvolume:/var/log/rhodecode
244 245 - rc_reposvolume:/var/opt/rhodecode_repo_store
245 246 - rc_datavolume:/var/opt/rhodecode_data
246 247
247 248 logging:
248 249 *custom-logging
249 250
250 251 labels:
251 252 - "traefik.enable=false"
252 253
253 254 svn:
254 255 networks:
255 256 - rhodecode_network
256 257 extra_hosts:
257 258 - "host.docker.internal:host-gateway"
258 259 image: rhodecode/rhodecode-${RC_EDITION}:${RC_VERSION:-4.28.0}
259 260
260 261 # build:
261 262 # context: .
262 263 # dockerfile: service/svn/rhodecode_svn.dockerfile
263 264 # args:
264 265 # APACHE_VER: 1.3
265 266
266 267 stdin_open: true
267 268 tty: true
268 269 restart: always
269 270 env_file:
270 271 - ${RC_ENV_FILE:?must-specify-rc-env-file}
271 272 command: ["apachectl", "-D", "FOREGROUND"]
272 273
273 274 environment:
274 275 RC_APP_TYPE: rhodecode_svn
275 276
276 277 # SVN Specific
277 278 MOD_DAV_SVN_PORT: 8090
278 279 APACHE_LOG_DIR: /var/log/rhodecode/svn
279 280 MOD_DAV_SVN_CONF_FILE: /etc/rhodecode/conf/svn/mod_dav_svn.conf
280 281
281 282 # ports:
282 283 # - "127.0.0.1::8090"
283 284
284 285 healthcheck:
285 286 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:8090/_server_status" ]
286 287 timeout: 30s
287 288 interval: 60s
288 289 retries: 10
289 290
290 291 volumes:
291 292 - confvolume:/etc/rhodecode/conf
292 293 - logvolume:/var/log/rhodecode
293 294 - rc_reposvolume:/var/opt/rhodecode_repo_store
295 - rc_datavolume:/var/opt/rhodecode_data
294 296
295 297 logging:
296 298 *custom-logging
297 299
298 300 sshd:
299 301 networks:
300 302 - rhodecode_network
301 303 extra_hosts:
302 304 - "host.docker.internal:host-gateway"
303 305 image: rhodecode/rhodecode-${RC_EDITION}:${RC_VERSION:-4.28.0}
304 306
305 307 stdin_open: true
306 308 tty: true
307 309 restart: always
308 310 env_file:
309 311 - ${RC_ENV_FILE:?must-specify-rc-env-file}
310 312 command: ["/usr/sbin/sshd", "-f", "/etc/rhodecode/sshd_config", "-D", "-e"]
311 313
312 314 environment:
313 315 RC_APP_TYPE: rhodecode_sshd
314 316 SSH_BOOTSTRAP: 1
315 317
316 318 # ports:
317 319 # # set from .env file
318 320 # - "${RC_SSH_PORT:?must-specify-ssh-port}:22"
319 321
320 322 volumes:
321 323 - confvolume:/etc/rhodecode/conf
322 324 - logvolume:/var/log/rhodecode
323 325 - rc_reposvolume:/var/opt/rhodecode_repo_store
324 326 - rc_datavolume:/var/opt/rhodecode_data
325 327
326 328 logging:
327 329 *custom-logging
328 330
329 331 labels:
330 332 - "traefik.enable=true"
331 333 - "traefik.http.routers.sshd.entrypoints=ssh"
332 334 - "traefik.http.routers.sshd.rule=Host(`*`)"
333 335 - "traefik.http.routers.sshd.service=rhodecode-ssh"
334 336 - "traefik.http.services.rhodecode-ssh.loadbalancer.server.port=${RC_SSH_PORT:?must-specify-ssh-port}"
@@ -1,54 +1,55 b''
1 1 version: '3.9'
2 2
3 3 ## Shared base stuff for all compose files in stack
4 4
5 5 x-logging: &custom-logging
6 6 # Install loki plugin
7 7 # docker plugin install grafana/loki-docker-driver:2.7.1 --alias loki --grant-all-permissions
8 8 # NOTE: loki logging driver ONLY works for host type networks...
9 9 # To cleanly uninstall the plugin, disable and remove it
10 10 # docker plugin disable loki --force && docker plugin rm loki
11 11 # debug: sudo journalctl -u docker.service | grep loki
12 12 driver: loki
13 13 options:
14 loki-url: "http://loki:3100/loki/api/v1/push"
14 #loki-url: "http://loki:3100/loki/api/v1/push"
15 loki-url: "http://127.0.0.1:3100/loki/api/v1/push"
15 16 loki-retries: "5"
16 17 loki-timeout: "1s"
17 18 loki-max-backoff: "800ms"
18 19
19 20 volumes:
20 21 # shared logvolume
21 22 logvolume:
22 23 driver: local
23 24 driver_opts:
24 25 type: none
25 26 o: bind
26 27 device: $PWD/logs
27 28
28 29 # bind-mount with configs
29 30 confvolume:
30 31 driver: local
31 32 driver_opts:
32 33 type: none
33 34 o: bind
34 35 device: $PWD/config/_shared
35 36
36 37 # SHARED volume for rhodecode caches, archive caches, nginx static,
37 38 # must be run via: docker volume create --name=rc_datavolume
38 39 rc_datavolume:
39 40 external: true
40 41
41 42 # volume for RhodeCode repo-store, it's where the repositories will be stored
42 43 # must be run via: docker volume create --name=rc_reposvolume
43 44 rc_reposvolume:
44 45 external: true
45 46
46 47 networks:
47 48
48 49 # SHARED network for all containers
49 50 # must be run via: docker network create --name=rhodecode_network
50 51 rhodecode_network:
51 52 name: rhodecode_network
52 53 driver: bridge
53 54 external: true
54 55
@@ -1,129 +1,131 b''
1 1 version: '3.9'
2 2
3 3 volumes:
4 4
5 5 prometheus_data:
6 6 labels:
7 7 "keep": 1
8 8
9 9 grafana_data:
10 10 labels:
11 11 "keep": 1
12 12
13 13 services:
14 14
15 15 statsd-exporter:
16 16 image: prom/statsd-exporter:v0.22.8
17 17 restart: always
18 18 command: [
19 19 '--statsd.mapping-config=/etc/statsd/statsd.yaml',
20 20 '--statsd.listen-udp=:9125',
21 21 '--web.listen-address=:9102'
22 22 ]
23 23 networks:
24 24 - rhodecode_network
25 25 # ports:
26 26 # - "9125:9125/udp"
27 27 # - "9102:9102"
28 28
29 29 volumes:
30 30 - ./config/statsd-exporter:/etc/statsd
31 31 labels:
32 32 - "traefik.enable=false"
33 33 - "traefik.http.services.statsd-exporter.loadbalancer.server.port=9125"
34 34 - "traefik.http.services.statsd-exporter.loadbalancer.server.port=9102"
35 35
36 36 node-exporter:
37 37 image: prom/node-exporter:v1.4.1
38 38 command:
39 39 - "--path.procfs=/host/proc"
40 40 - "--path.rootfs=/rootfs"
41 41 - "--path.sysfs=/host/sys"
42 42 - "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
43 43 - "--collector.systemd"
44 44 - "--collector.processes"
45 45 networks:
46 46 - rhodecode_network
47 47 pid: host
48 48 restart: always
49 49 # ports:
50 50 # - "9100:9100"
51 51 volumes:
52 52 - "/proc:/host/proc:ro"
53 53 - "/sys:/host/sys:ro"
54 54 - "/:/rootfs:ro"
55 55 labels:
56 56 - "traefik.enable=false"
57 57 - "traefik.http.services.node-exporter.loadbalancer.server.port=9100"
58 58
59 59 prometheus:
60 60 image: prom/prometheus:v2.40.6
61 61 restart: always
62 62 command:
63 63 - "--config.file=/etc/prometheus/prometheus.yml"
64 64 - "--storage.tsdb.path=/prometheus"
65 65 - "--web.console.libraries=/etc/prometheus/console_libraries"
66 66 - "--web.console.templates=/etc/prometheus/consoles"
67 67 - "--storage.tsdb.retention.time=24h"
68 68 - "--web.enable-lifecycle"
69 69 # ports:
70 70 # - "9090:9090"
71 71 networks:
72 72 - rhodecode_network
73 73 volumes:
74 74 - ./config/prometheus:/etc/prometheus
75 75 - prometheus_data:/prometheus
76 76 labels:
77 77 - "traefik.enable=false"
78 78 - "traefik.http.services.prometheus.loadbalancer.server.port=9090"
79 79
80 80 grafana:
81 81 image: grafana/grafana:9.3.1
82 82 restart: always
83 83 # ports:
84 84 # - "3000:3000"
85 85 volumes:
86 86 - grafana_data:/var/lib/grafana
87 87 - ./config/grafana:/etc/grafana
88 88 networks:
89 89 - rhodecode_network
90 90 labels:
91 91 - "traefik.enable=true"
92 92 - "traefik.http.routers.grafana.entrypoints=http"
93 93 - "traefik.http.routers.grafana.rule=PathPrefix(`/_grafana`)"
94 94 - "traefik.http.routers.grafana.service=grafana-http"
95 95 - "traefik.http.services.grafana-http.loadbalancer.server.port=3000"
96 96 # SSL + proxy prefix example, should be put into .custom/docker-compose-metrics.override.yaml
97 97 #- "traefik.http.routers.grafana-rt.entrypoints=https"
98 98 #- "traefik.http.routers.grafana-rt.rule=Host(`metrics.example.com`) && PathPrefix(`/_grafana`)"
99 99 #- "traefik.http.routers.grafana-rt.tls=true"
100 100 #- "traefik.http.routers.grafana-rt.service=grafana-ssl"
101 101 #- "traefik.http.services.grafana-ssl.loadbalancer.server.port=3000"
102 102
103 103 loki:
104 104 image: grafana/loki:2.7.1
105 105 restart: always
106 # ports:
107 # - "3100:3100"
106 ports:
107 # Loki port is the only one that needs explicitly
108 # be exposed because of logging driver host-only woking mode
109 - "3100:3100"
108 110 # - "9095:9095"
109 111 command: [
110 112 "-config.file=/etc/loki/loki-config.yaml"
111 113 ]
112 114 networks:
113 115 - rhodecode_network
114 116 volumes:
115 117 - ./config/loki:/etc/loki
116 118
117 119 promtail:
118 120 image: grafana/promtail:2.7.1
119 121 command: [
120 122 "-config.file=/etc/promtail/promtail-config.yaml"
121 123 ]
122 124 networks:
123 125 - rhodecode_network
124 126 volumes:
125 127 - /var/log:/var/log
126 128 - logvolume:/var/log_volume
127 129 - ./config/promtail:/etc/promtail
128 130 labels:
129 131 - "traefik.enable=false"
@@ -1,43 +1,44 b''
1 1 version: '3.9'
2 2
3 3 x-logging: &custom-logging
4 4 # docker plugin install grafana/loki-docker-driver:2.7.1 --alias loki --grant-all-permissions
5 5 # NOTE: loki logging driver ONLY works for host type networks...
6 6 driver: loki
7 7 options:
8 loki-url: "http://loki:3100/loki/api/v1/push"
8 #loki-url: "http://loki:3100/loki/api/v1/push"
9 loki-url: "http://127.0.0.1:3100/loki/api/v1/push"
9 10 loki-retries: "5"
10 11 loki-timeout: "1s"
11 12 loki-max-backoff: "800ms"
12 13
13 14 ## docker network create -d overlay lb-net
14 15 services:
15 16
16 17 traefik:
17 18
18 19 image: traefik:v2.9.6
19 20
20 21 ports:
21 22 # The HTTP port, exposed as http entrypoint
22 23 - "80:80"
23 24 # The HTTPS port, exposed as https entrypoint
24 25 - "443:443"
25 26 # The SSH port
26 27 - "${RC_SSH_PORT}:${RC_SSH_PORT}"
27 28 volumes:
28 29 # So that Traefik can listen to the Docker events
29 30 - /var/run/docker.sock:/var/run/docker.sock
30 31 - ./config/traefik:/etc/traefik
31 32 deploy:
32 33 placement:
33 34 constraints:
34 35 # limit swarm deploy to MANAGER only
35 36 - node.role == manager
36 37 networks:
37 38 - rhodecode_network
38 39
39 40 labels:
40 41 - "traefik.enable=true"
41 42
42 43 logging:
43 44 *custom-logging
@@ -1,247 +1,248 b''
1 1 version: '3.9'
2 2
3 3 x-logging: &custom-logging
4 4 # docker plugin install grafana/loki-docker-driver:2.7.1 --alias loki --grant-all-permissions
5 5 # NOTE: loki logging driver ONLY works for host type networks...
6 6 driver: loki
7 7 options:
8 loki-url: "http://loki:3100/loki/api/v1/push"
8 #loki-url: "http://loki:3100/loki/api/v1/push"
9 loki-url: "http://127.0.0.1:3100/loki/api/v1/push"
9 10 loki-retries: "5"
10 11 loki-timeout: "1s"
11 12 loki-max-backoff: "800ms"
12 13
13 14 volumes:
14 15
15 16 # volume for redis data store
16 17 redis_data:
17 18 labels:
18 19 "keep": 1
19 20
20 21 # volume for Postgres db store
21 22
22 23 # volume for Postgres Data
23 24 pg_data:
24 25 labels:
25 26 "keep": 1
26 27
27 28 # volume for rhodecode elasticsearch
28 29 es_data:
29 30 labels:
30 31 "keep": 1
31 32
32 33
33 34 services:
34 35
35 36 channelstream:
36 37 networks:
37 38 - rhodecode_network
38 39 image: channelstream/channelstream:0.7.1
39 40
40 41 restart: always
41 42
42 43 # ports:
43 44 # - "127.0.0.1:9800:9800"
44 45 env_file:
45 46 - ${RC_ENV_FILE:?must-specify-rc-env-file}
46 47 command: ["channelstream"]
47 48
48 49 healthcheck:
49 50 test: [ "CMD", "curl", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://channelstream:8000/admin/sign_in" ]
50 51 timeout: 5s
51 52 interval: 60s
52 53 retries: 10
53 54
54 55 volumes:
55 56 - confvolume:/etc/rhodecode/conf
56 57 - logvolume:/var/log/rhodecode
57 58
58 59 logging:
59 60 *custom-logging
60 61
61 62 labels:
62 63 - "traefik.enable=false"
63 64 #- "traefik.http.routers.channelstream.entrypoints=http"
64 65 #- "traefik.http.services.channelstream.loadbalancer.server.port=9800"
65 66
66 67 profiles:
67 68 ["channelstream"]
68 69
69 70 nginx:
70 71 networks:
71 72 - rhodecode_network
72 73 image: library/nginx:1.23.2
73 74
74 75 restart: always
75 76
76 77 environment:
77 78 NGINX_ENTRYPOINT_QUIET_LOGS: 1
78 79 env_file:
79 80 - ${RC_ENV_FILE:?must-specify-rc-env-file}
80 81
81 82 healthcheck:
82 83 # change port 80 to 443 when only using SSL
83 84 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:80/_health" ]
84 85 timeout: 30s
85 86 interval: 60s
86 87 retries: 10
87 88
88 89 # depends_on:
89 90 # - channelstream
90 91
91 92 volumes:
92 93 - ./config/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
93 94 - ./config/nginx/http.conf:/etc/nginx/http.conf:ro
94 95 - ./config/nginx/proxy.conf:/etc/nginx/proxy.conf:ro
95 96 - logvolume:/var/log/rhodecode
96 97 - rc_datavolume:/var/opt/rhodecode_data
97 98
98 99 logging:
99 100 *custom-logging
100 101
101 102 labels:
102 103 - "traefik.enable=true"
103 104 - "traefik.http.routers.nginx.entrypoints=http"
104 105 - "traefik.http.routers.nginx.rule=Host(`${RC_HOSTNAME:?must-specify-rhodecode-hostname}`) && ( PathPrefix(`/_health`) || PathPrefix(`/_channelstream`) || PathPrefix(`/_static/rhodecode`) )"
105 106 - "traefik.http.services.nginx.loadbalancer.server.port=80"
106 107
107 108 elasticsearch:
108 109 networks:
109 110 - rhodecode_network
110 111 image: elasticsearch:6.8.23
111 112
112 113 environment:
113 114 - cluster.name=elasticsearch-cluster
114 115 - network.host=0.0.0.0
115 116 - bootstrap.memory_lock=true
116 117 - discovery.type=single-node
117 118 - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
118 119 env_file:
119 120 - ${RC_ENV_FILE:?must-specify-rc-env-file}
120 121 healthcheck:
121 122 # change port 80 to 443 when only using SSL
122 123 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "elasticsearch:9200/_cat/health" ]
123 124 timeout: 30s
124 125 interval: 60s
125 126 retries: 10
126 127
127 128 ulimits:
128 129 memlock:
129 130 soft: -1
130 131 hard: -1
131 132
132 133 volumes:
133 134 - es_data:/usr/share/elasticsearch/data
134 135
135 136 logging:
136 137 *custom-logging
137 138
138 139 profiles:
139 140 ["elasticsearch"]
140 141
141 142 redis:
142 143 networks:
143 144 - rhodecode_network
144 145 image: library/redis:7.0.5
145 146
146 147 restart: always
147 148 env_file:
148 149 - ${RC_ENV_FILE:?must-specify-rc-env-file}
149 150 command:
150 151 - "redis-server"
151 152 - "/etc/redis/redis.conf"
152 153 - "--maxmemory-policy allkeys-lru"
153 154 - "--maxmemory ${RC_REDIS_MAXMEMORY:?must-specify-redis-maxmemory}"
154 155
155 156 # ports:
156 157 # - "127.0.0.1::6379"
157 158
158 159 healthcheck:
159 160 test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
160 161 interval: 60s
161 162
162 163 volumes:
163 164 - ./config/redis/redis.conf:/etc/redis/redis.conf:ro
164 165 - logvolume:/var/log/rhodecode
165 166 - redis_data:/data
166 167
167 168 profiles:
168 169 ["redis"]
169 170
170 171 logging:
171 172 *custom-logging
172 173
173 174 database:
174 175 networks:
175 176 - rhodecode_network
176 177 image: library/postgres:14.6
177 178
178 179 environment:
179 180 POSTGRES_DB: ${DB_NAME:?must-specify-db-name}
180 181 POSTGRES_USER: ${DB_USER:?must-specify-db-user}
181 182 PGUSER: ${DB_USER:?must-specify-db-user}
182 183 POSTGRES_PASSWORD: ${DB_PASSWORD:?must-specify-db-password}
183 184 POSTGRES_HOST_AUTH_METHOD: md5
184 185 POSTGRES_INITDB_ARGS: "--auth-host=md5 --auth-local=md5"
185 186 env_file:
186 187 - ${RC_ENV_FILE:?must-specify-rc-env-file}
187 188
188 189 restart: always
189 190 command:
190 191 - "postgres"
191 192 - "-c"
192 193 - "log_statement=ddl"
193 194 - "-c"
194 195 - "config_file=/etc/conf.d/pg_customized.conf"
195 196
196 197 # ports:
197 198 # - "127.0.0.1::5432"
198 199
199 200 healthcheck:
200 201 test: ["CMD-SHELL", "pg_isready", '-U', "$DB_USER"]
201 202 interval: 10s
202 203 timeout: 5s
203 204 retries: 5
204 205
205 206 volumes:
206 207 - $PWD/config/database/pg_customized.conf:/etc/conf.d/pg_customized.conf:ro
207 208 # db dumps reverse mount
208 209 - $PWD/.custom/db_dump:/var/rc-data-dump
209 210 # save the pg_data volume
210 211 - pg_data:/var/lib/postgresql/data
211 212 - logvolume:/var/log/rhodecode
212 213
213 214 profiles:
214 215 ["postgres"]
215 216
216 217 logging:
217 218 *custom-logging
218 219
219 220 database-mysql:
220 221 networks:
221 222 - rhodecode_network
222 223 image: library/mysql:8.0.31
223 224
224 225 environment:
225 226 MYSQL_DATABASE: ${DB_NAME:?must-specify-db-name}
226 227 MYSQL_USER: ${DB_USER:?must-specify-db-user}
227 228 MYSQL_PASSWORD: ${DB_PASSWORD:?must-specify-db-password}
228 229 MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:?must-specify-db-password}
229 230 env_file:
230 231 - ${RC_ENV_FILE:?must-specify-rc-env-file}
231 232
232 233 restart: always
233 234
234 235 # ports:
235 236 # - "127.0.0.1::3306"
236 237
237 238 volumes:
238 239 - ./config/database/mysql_customized.conf:/etc/mysql/conf.d/config-file.cnf:ro
239 240 # save the mysql_data volume
240 241 - $PWD/mysql_dir:/var/lib/mysql
241 242 - logvolume:/var/log/rhodecode
242 243
243 244 profiles:
244 245 ["mysql"]
245 246
246 247 logging:
247 248 *custom-logging
General Comments 0
You need to be logged in to leave comments. Login now