##// END OF EJS Templates
compose: expose host network to access for external DB
super-admin -
Show More
@@ -1,305 +1,317 b''
1 1 version: '3.9'
2 2
3 3 x-logging: &custom-logging
4 4 # docker plugin install grafana/loki-docker-driver:latest --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 8 loki-url: "http://127.0.0.1:3100/loki/api/v1/push"
9 9 #loki-url: "http://loki:3100/loki/api/v1/push"
10 10 loki-retries: "5"
11 11 loki-timeout: "1s"
12 12 loki-max-backoff: "800ms"
13 13
14 14
15 15 services:
16 16
17 17 rhodecode:
18 18 networks:
19 19 - rhodecode_network
20 extra_hosts:
21 - "host.docker.internal:host-gateway"
20 22 image: rhodecode/rhodecode-${RC_EDITION}:${RC_VERSION:-4.28.0}
21 23 stdin_open: true
22 24 tty: true
23 25 restart: always
24 26 command: [
25 27 "/usr/local/bin/rhodecode_bin/bin/gunicorn",
26 28 "--name=gunicorn-rhodecode-1",
27 29 "--error-logfile=-",
28 30 "--paster=/etc/rhodecode/conf/rhodecode.optimized.ini",
29 31 "--config=/etc/rhodecode/conf/gunicorn_conf_rc.py"
30 32 ]
31 33 deploy:
32 34 # override this in .custom/docker-compose-apps.override.yaml to scale up
33 35 replicas: 1
34 36
35 37 # ports:
36 38 # - "127.0.0.1::10020"
37 39
38 40 build:
39 41 context: .
40 42 dockerfile: service/rhodecode/rhodecode.dockerfile
41 43 args:
42 44 TZ: ${TZ}
43 45 RHODECODE_VERSION: ${RC_VERSION:-4.28.0}
44 46 RHODECODE_DB: postgresql://rhodecode:${DB_PASSWORD:?must-specify-db-password}@database/${DB_NAME:?must-specify-db-name}
45 47 RHODECODE_USER_NAME: ${RHODECODE_USER_NAME}
46 48 RHODECODE_USER_PASS: ${RHODECODE_USER_PASS}
47 49 RHODECODE_USER_EMAIL: ${RHODECODE_USER_EMAIL}
48 50
49 51 environment:
50 52 RC_APP_TYPE: rhodecode_http
51 53 RC_APP_PROC: 1
52 54 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
53 55 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
54 56 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
55 57 GEVENT_RESOLVER: "ares"
56 58
57 59 DB_UPGRADE: 1 # run the DB upgrade
58 60 SETUP_APP: 1 # run the application default settings setup, can be turned off after initial run
59 61 #FORCE_DB_INIT_FILE: 1 # force the database init, warning: destroys old DB
60 62 #FORCE_RC_SETUP_APP: 1 # force running setup scripts for configuration/license application
61 63 MAIN_INI_PATH: /etc/rhodecode/conf/rhodecode.optimized.ini
62 64
63 65 # SVN Specific
64 66 MOD_DAV_SVN_PORT: 8090
65 67 APACHE_LOG_DIR: /var/log/rhodecode/svn
66 68 MOD_DAV_SVN_CONF_FILE: /etc/rhodecode/conf/svn/mod_dav_svn.conf
67 69
68 70 healthcheck:
69 71 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:10020/_admin/ops/ping" ]
70 72 timeout: 30s
71 73 interval: 60s
72 74 retries: 10
73 75
74 76 # depends_on:
75 77 # - database
76 78 # - redis
77 79 # - channelstream
78 80
79 81 volumes:
80 82 - confvolume:/etc/rhodecode/conf
81 83 - logvolume:/var/log/rhodecode
82 84 - rc_reposvolume:/var/opt/rhodecode_repo_store
83 85 - rc_datavolume:/var/opt/rhodecode_data
84 86
85 87 tmpfs:
86 88 - /data_ramdisk:size=${RC_DATA_RAMDISK_SIZE:?specify-RC_DATA_RAMDISK_SIZE-env-var}
87 89
88 90 logging:
89 91 *custom-logging
90 92
91 93 labels:
92 94 - "traefik.enable=true"
93 95 - "traefik.http.routers.rhodecode.entrypoints=http"
94 96 - "traefik.http.routers.rhodecode.rule=Host(`${RHODECODE_HOSTNAME:?must-specify-rhodecode-hostname}`)"
95 97 - "traefik.http.services.rhodecode.loadbalancer.server.port=10020"
96 98
97 99 vcsserver:
98 100 networks:
99 101 - rhodecode_network
102 extra_hosts:
103 - "host.docker.internal:host-gateway"
100 104 image: rhodecode/rhodecode-${RC_EDITION}:${RC_VERSION:-4.28.0}
101 105
102 106 stdin_open: true
103 107 tty: true
104 108 restart: always
105 109 command: [
106 110 "/home/rhodecode/.rccontrol/vcsserver-1/profile/bin/gunicorn",
107 111 "--name=gunicorn-vcsserver-1",
108 112 "--error-logfile=-",
109 113 "--paster=/etc/rhodecode/conf/vcsserver.optimized.ini",
110 114 "--config=/etc/rhodecode/conf/gunicorn_conf_vcs.py"
111 115 ]
112 116 deploy:
113 117 # override this in .custom/docker-compose-apps.override.yaml to scale up
114 118 replicas: 1
115 119
116 120 # ports:
117 121 # - "127.0.0.1::10010"
118 122
119 123 healthcheck:
120 124 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:10010/status" ]
121 125 timeout: 30s
122 126 interval: 60s
123 127 retries: 10
124 128
125 129 environment:
126 130 RC_APP_TYPE: rhodecode_vcsserver
127 131 RC_APP_PROC: 1
128 132 MAIN_INI_PATH: /etc/rhodecode/conf/vcsserver.optimized.ini
129 133 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
130 134 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
131 135 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
132 136
133 137 # depends_on:
134 138 # - redis
135 139
136 140 volumes:
137 141 - confvolume:/etc/rhodecode/conf
138 142 - logvolume:/var/log/rhodecode
139 143 - rc_reposvolume:/var/opt/rhodecode_repo_store
140 144 - rc_datavolume:/var/opt/rhodecode_data
141 145
142 146 logging:
143 147 *custom-logging
144 148
145 149 celery:
146 150 networks:
147 151 - rhodecode_network
152 extra_hosts:
153 - "host.docker.internal:host-gateway"
148 154 image: rhodecode/rhodecode-${RC_EDITION}:${RC_VERSION:-4.28.0}
149 155
150 156 stdin_open: true
151 157 tty: true
152 158 restart: always
153 159 command: [
154 160 "/usr/local/bin/rhodecode_bin/bin/celery",
155 161 "worker",
156 162 "--task-events",
157 163 "--autoscale=10,2",
158 164 "--no-color",
159 165 "--app=rhodecode.lib.celerylib.loader",
160 166 "--loglevel=DEBUG",
161 167 "--ini=/etc/rhodecode/conf/rhodecode.optimized.ini"
162 168 ]
163 169
164 170 environment:
165 171 RC_APP_TYPE: rhodecode_celery
166 172 RC_APP_PROC: 1
167 173 MAIN_INI_PATH: /etc/rhodecode/conf/rhodecode.optimized.ini
168 174 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
169 175 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
170 176 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
171 177
172 178 # depends_on:
173 179 # - database
174 180 # - redis
175 181
176 182 volumes:
177 183 - confvolume:/etc/rhodecode/conf
178 184 - logvolume:/var/log/rhodecode
179 185 - rc_reposvolume:/var/opt/rhodecode_repo_store
180 186 - rc_datavolume:/var/opt/rhodecode_data
181 187
182 188 logging:
183 189 *custom-logging
184 190
185 191 labels:
186 192 - "traefik.enable=false"
187 193
188 194 celery-beat:
189 195 # This service is not scalable
190 196 networks:
191 197 - rhodecode_network
198 extra_hosts:
199 - "host.docker.internal:host-gateway"
192 200 image: rhodecode/rhodecode-${RC_EDITION}:${RC_VERSION:-4.28.0}
193 201
194 202 stdin_open: true
195 203 tty: true
196 204 restart: always
197 205 command: [
198 206 "/usr/local/bin/rhodecode_bin/bin/celery",
199 207 "beat",
200 208 "--no-color",
201 209 "--app=rhodecode.lib.celerylib.loader",
202 210 "--scheduler=rhodecode.lib.celerylib.scheduler.RcScheduler",
203 211 "--loglevel=DEBUG",
204 212 "--ini=/etc/rhodecode/conf/rhodecode.optimized.ini"
205 213 ]
206 214
207 215 environment:
208 216 RC_APP_TYPE: rhodecode_beat
209 217 RC_APP_PROC: 1
210 218 MAIN_INI_PATH: /etc/rhodecode/conf/rhodecode.optimized.ini
211 219 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
212 220 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
213 221 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
214 222
215 223 # depends_on:
216 224 # - database
217 225 # - redis
218 226
219 227 volumes:
220 228 - confvolume:/etc/rhodecode/conf
221 229 - logvolume:/var/log/rhodecode
222 230 - rc_reposvolume:/var/opt/rhodecode_repo_store
223 231 - rc_datavolume:/var/opt/rhodecode_data
224 232
225 233 logging:
226 234 *custom-logging
227 235
228 236 labels:
229 237 - "traefik.enable=false"
230 238
231 239 svn:
232 240 networks:
233 241 - rhodecode_network
242 extra_hosts:
243 - "host.docker.internal:host-gateway"
234 244 image: rhodecode/rhodecode-${RC_EDITION}:${RC_VERSION:-4.28.0}
235 245
236 246 # build:
237 247 # context: .
238 248 # dockerfile: service/svn/rhodecode_svn.dockerfile
239 249 # args:
240 250 # APACHE_VER: 1.3
241 251
242 252 stdin_open: true
243 253 tty: true
244 254 restart: always
245 255 command: ["apachectl", "-D", "FOREGROUND"]
246 256
247 257 environment:
248 258 RC_APP_TYPE: rhodecode_svn
249 259
250 260 # SVN Specific
251 261 MOD_DAV_SVN_PORT: 8090
252 262 APACHE_LOG_DIR: /var/log/rhodecode/svn
253 263 MOD_DAV_SVN_CONF_FILE: /etc/rhodecode/conf/svn/mod_dav_svn.conf
254 264
255 265 # ports:
256 266 # - "127.0.0.1::8090"
257 267
258 268 healthcheck:
259 269 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:8090/_server_status" ]
260 270 timeout: 30s
261 271 interval: 60s
262 272 retries: 10
263 273
264 274 volumes:
265 275 - confvolume:/etc/rhodecode/conf
266 276 - logvolume:/var/log/rhodecode
267 277 - rc_reposvolume:/var/opt/rhodecode_repo_store
268 278
269 279 logging:
270 280 *custom-logging
271 281
272 282 sshd:
273 283 networks:
274 284 - rhodecode_network
285 extra_hosts:
286 - "host.docker.internal:host-gateway"
275 287 image: rhodecode/rhodecode-${RC_EDITION}:${RC_VERSION:-4.28.0}
276 288
277 289 stdin_open: true
278 290 tty: true
279 291 restart: always
280 292 command: ["/usr/sbin/sshd", "-f", "/etc/rhodecode/sshd_config", "-D", "-e"]
281 293
282 294 environment:
283 295 RC_APP_TYPE: rhodecode_sshd
284 296 SSH_BOOTSTRAP: 1
285 297
286 298 # ports:
287 299 # # set from .env file
288 300 # - "${RC_SSH_PORT:?must-specify-ssh-port}:22"
289 301
290 302 volumes:
291 303 - confvolume:/etc/rhodecode/conf
292 304 - logvolume:/var/log/rhodecode
293 305 - rc_reposvolume:/var/opt/rhodecode_repo_store
294 306 - rc_datavolume:/var/opt/rhodecode_data
295 307
296 308 logging:
297 309 *custom-logging
298 310
299 311 labels:
300 312 - "traefik.enable=true"
301 313 - "traefik.http.routers.sshd.entrypoints=ssh"
302 314 - "traefik.http.routers.sshd.rule=Host(`*`)"
303 315 - "traefik.http.services.sshd.loadbalancer.server.port=${RC_SSH_PORT:?must-specify-ssh-port}"
304 316
305 317
General Comments 0
You need to be logged in to leave comments. Login now