##// END OF EJS Templates
docker: recent changes for build
marcink -
r3:645270a3
parent child Browse files
Show More
@@ -1,24 +1,25 b''
1 COMPOSE_PROJECT_NAME=rc_cluster
1 COMPOSE_PROJECT_NAME=rc_cluster
2 TZ="UTC"
2 TZ="UTC"
3
3
4 # Version to deploy and run
4 # Version to deploy and run
5 RC_VERSION="4.24.1"
5 RC_VERSION="4.24.1"
6
6
7 # Database access credentials
7 # Database access credentials
8 POSTGRES_DB=rhodecode
8 POSTGRES_DB=rhodecode
9 POSTGRES_USER=rhodecode
9 POSTGRES_PASSWORD=hUc1adS7oDd6Oj3in3
10 POSTGRES_PASSWORD=hUc1adS7oDd6Oj3in3
10
11
11 # base url for running app
12 # base url for running app
12 RHODECODE_BASE_URL=http://localhost:8888
13 RHODECODE_BASE_URL=http://localhost:8888
13
14
14 # HTTP and HTTPS ports for running app
15 # HTTP and HTTPS ports for running app
15 RC_HTTP_PORT=8888
16 RC_HTTP_PORT=8888
16 RC_HTTPS_PORT=8443
17 RC_HTTPS_PORT=8443
17
18
18 # SSH Port exposed, increased security is to not used default 22
19 # SSH Port exposed, increased security is to not used default 22
19 RC_SSH_PORT=9022
20 RC_SSH_PORT=9022
20
21
21 # user/password for first admin user created for access
22 # user/password for first admin user created for access
22 RHODECODE_USER_EMAIL=admin@rhodecode.com
23 RHODECODE_USER_EMAIL=admin@rhodecode.com
23 RHODECODE_USER_NAME=admin
24 RHODECODE_USER_NAME=admin
24 RHODECODE_USER_PASS=qweqwe
25 RHODECODE_USER_PASS=qweqwe
@@ -1,392 +1,408 b''
1 version: '3.9'
1 version: '3.9'
2
2
3 volumes:
3 volumes:
4
4
5 # bind volume with logs
5 # bind volume with logs
6 logvolume:
6 logvolume:
7 driver: local
7 driver: local
8 driver_opts:
8 driver_opts:
9 type: none
9 type: none
10 o: bind
10 o: bind
11 device: $PWD/logs
11 device: $PWD/logs
12
12
13 # bind-mount with configs
13 # bind-mount with configs
14 confvolume:
14 confvolume:
15 driver: local
15 driver: local
16 driver_opts:
16 driver_opts:
17 type: none
17 type: none
18 o: bind
18 o: bind
19 device: $PWD/config
19 device: $PWD/config
20
20
21 # volume for rhodecode caches, archive caches, elasticsearch etc
21 # volume for rhodecode caches, archive caches, elasticsearch etc
22 datavolume: {}
22 datavolume: {}
23
23
24 # postgres store
24 # volume for RhodeCode repo-store, it's where the repositories will be stored
25 pg_data: {}
25 rhodecode_repos:
26 labels:
27 "keep": 1
28
29 # volume for postgres db store
30 pg_data:
31 labels:
32 "keep": 1
26
33
27 # volume for rhodecode elasticsearch
34 # volume for rhodecode elasticsearch
28 es_data: {}
35 es_data:
36 labels:
37 "keep": 1
29
38
30 # RhodeCode repo-store, it's where the repositories will be stored
31 rhodecode_repos: {}
32
39
33 networks:
40 networks:
34 rhodecode_network:
41 rhodecode_network:
35 name: rhodecode_network
42 name: rhodecode_network
36
43
37 services:
44 services:
38
45
39 rhodecode:
46 rhodecode:
40 networks:
47 networks:
41 - rhodecode_network
48 - rhodecode_network
42 image: rhodecode/app:${RC_VERSION:?specify-RC_VERSION-env-var}
49 image: rhodecode/app:${RC_VERSION:?specify-RC_VERSION-env-var}
43 stdin_open: true
50 stdin_open: true
44 tty: true
51 tty: true
45 restart: unless-stopped
52 restart: unless-stopped
46 command: [
53 command: [
47 "/var/opt/rhodecode_bin/bin/gunicorn",
54 "/var/opt/rhodecode_bin/bin/gunicorn",
48 "--name",
55 "--name=gunicorn-rhodecode-1",
49 "gunicorn-rhodecode-1",
50 "--error-logfile=-",
56 "--error-logfile=-",
51 "--paster=/etc/rhodecode/conf/compose/rhodecode.optimized.ini",
57 "--paster=/etc/rhodecode/conf/compose/rhodecode.optimized.ini",
52 "--config=/etc/rhodecode/conf/gunicorn_conf.py"
58 "--config=/etc/rhodecode/conf/gunicorn_conf.py"
53 ]
59 ]
54 ports:
60 ports:
55 - "127.0.0.1::10020"
61 - "127.0.0.1::10020"
56
62
57 build:
63 build:
58 context: .
64 context: .
59 dockerfile: service/rhodecode/rhodecode.dockerfile
65 dockerfile: service/rhodecode/rhodecode.dockerfile
60 network: rhodecode_network
66 #network: rhodecode_network
61 args:
67 args:
62 TZ: ${TZ}
68 TZ: ${TZ}
63 RHODECODE_VERSION: ${RC_VERSION:?specify-RC_VERSION-env-var}
69 RHODECODE_VERSION: ${RC_VERSION:?specify-RC_VERSION-env-var}
64 RHODECODE_DB: postgresql://rhodecode:${POSTGRES_PASSWORD:?must-specify-db-password}@database/${POSTGRES_DB:?must-specify-db-name}
70 RHODECODE_DB: postgresql://rhodecode:${POSTGRES_PASSWORD:?must-specify-db-password}@database/${POSTGRES_DB:?must-specify-db-name}
65 RHODECODE_USER_NAME: ${RHODECODE_USER_NAME}
71 RHODECODE_USER_NAME: ${RHODECODE_USER_NAME}
66 RHODECODE_USER_PASS: ${RHODECODE_USER_PASS}
72 RHODECODE_USER_PASS: ${RHODECODE_USER_PASS}
67 RHODECODE_USER_EMAIL: ${RHODECODE_USER_EMAIL}
73 RHODECODE_USER_EMAIL: ${RHODECODE_USER_EMAIL}
68
74
69 environment:
75 environment:
70 RC_APP_TYPE: rhodecode_http
76 RC_APP_TYPE: rhodecode_http
71 RC_APP_PROC: 1
77 RC_APP_PROC: 1
72 ENV_RC_BASE_URL: ${RHODECODE_BASE_URL}
78 ENV_RC_BASE_URL: ${RHODECODE_BASE_URL}
73 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
79 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
74 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
80 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
75 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
81 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
76 GEVENT_RESOLVER: "ares"
82 GEVENT_RESOLVER: "ares"
77
83
78 DB_UPGRADE: 1 # run the DB upgrade
84 DB_UPGRADE: 1 # run the DB upgrade
79 SETUP_APP: 1 # run the application default settings setup, can be turned off after initial run
85 SETUP_APP: 1 # run the application default settings setup, can be turned off after initial run
80 MAIN_INI_PATH: /etc/rhodecode/conf/compose/rhodecode.optimized.ini
86 MAIN_INI_PATH: /etc/rhodecode/conf/compose/rhodecode.optimized.ini
81
87
82 # SVN Specific
88 # SVN Specific
83 MOD_DAV_SVN_PORT: 8090
89 MOD_DAV_SVN_PORT: 8090
84 APACHE_LOG_DIR: /var/log/rhodecode/svn
90 APACHE_LOG_DIR: /var/log/rhodecode/svn
85 MOD_DAV_SVN_CONF_FILE: /etc/rhodecode/conf/svn/mod_dav_svn.conf
91 MOD_DAV_SVN_CONF_FILE: /etc/rhodecode/conf/svn/mod_dav_svn.conf
86
92
87
88 healthcheck:
93 healthcheck:
89 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:10020/_admin/ops/ping" ]
94 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:10020/_admin/ops/ping" ]
90 timeout: 30s
95 timeout: 30s
91 interval: 60s
96 interval: 60s
92 retries: 10
97 retries: 10
93
98
94 depends_on:
99 depends_on:
95 - database
100 - database
96 - redis
101 - redis
97
102
98 volumes:
103 volumes:
99 - confvolume:/etc/rhodecode/conf
104 - confvolume:/etc/rhodecode/conf
100 - logvolume:/var/log/rhodecode
105 - logvolume:/var/log/rhodecode
101 - rhodecode_repos:/var/opt/rhodecode_repo_store
106 - rhodecode_repos:/var/opt/rhodecode_repo_store
102 - datavolume:/var/opt/rhodecode_data
107 - datavolume:/var/opt/rhodecode_data
103
108
104 tmpfs:
109 tmpfs:
105 - /data_ramdisk:size=1G
110 - /data_ramdisk:size=1G
106
111
107 vcsserver:
112 vcsserver:
108 networks:
113 networks:
109 - rhodecode_network
114 - rhodecode_network
110 image: rhodecode/app:${RC_VERSION:?specify-RC_VERSION-env-var}
115 image: rhodecode/app:${RC_VERSION:?specify-RC_VERSION-env-var}
111 stdin_open: true
116 stdin_open: true
112 tty: true
117 tty: true
113 restart: unless-stopped
118 restart: unless-stopped
114 command: [
119 command: [
115 "/home/rhodecode/.rccontrol/vcsserver-1/profile/bin/gunicorn",
120 "/home/rhodecode/.rccontrol/vcsserver-1/profile/bin/gunicorn",
116 "--name=gunicorn-vcsserver-1",
121 "--name=gunicorn-vcsserver-1",
117 "--error-logfile=-",
122 "--error-logfile=-",
118 "--paster=/etc/rhodecode/conf/compose/vcsserver.optimized.ini",
123 "--paster=/etc/rhodecode/conf/compose/vcsserver.optimized.ini",
119 "--config=/etc/rhodecode/conf/gunicorn_conf.py"
124 "--config=/etc/rhodecode/conf/gunicorn_conf.py"
120 ]
125 ]
121 ports:
126 ports:
122 - "127.0.0.1::10010"
127 - "127.0.0.1::10010"
123
128
124 healthcheck:
129 healthcheck:
125 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:10010/status" ]
130 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:10010/status" ]
126 timeout: 30s
131 timeout: 30s
127 interval: 60s
132 interval: 60s
128 retries: 10
133 retries: 10
129
134
130 environment:
135 environment:
131 RC_APP_TYPE: rhodecode_vcsserver
136 RC_APP_TYPE: rhodecode_vcsserver
132 RC_APP_PROC: 1
137 RC_APP_PROC: 1
133 MAIN_INI_PATH: /etc/rhodecode/conf/compose/vcsserver.optimized.ini
138 MAIN_INI_PATH: /etc/rhodecode/conf/compose/vcsserver.optimized.ini
134 ENV_RC_BASE_URL: ${RHODECODE_BASE_URL}
139 ENV_RC_BASE_URL: ${RHODECODE_BASE_URL}
135 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
140 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
136 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
141 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
137 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
142 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
138
143
139 depends_on:
144 depends_on:
140 - redis
145 - redis
141
146
142 volumes:
147 volumes:
143 - confvolume:/etc/rhodecode/conf
148 - confvolume:/etc/rhodecode/conf
144 - logvolume:/var/log/rhodecode
149 - logvolume:/var/log/rhodecode
145 - rhodecode_repos:/var/opt/rhodecode_repo_store
150 - rhodecode_repos:/var/opt/rhodecode_repo_store
146 - datavolume:/var/opt/rhodecode_data
151 - datavolume:/var/opt/rhodecode_data
147
152
148 celery:
153 celery:
149 networks:
154 networks:
150 - rhodecode_network
155 - rhodecode_network
151 image: rhodecode/app:${RC_VERSION:?specify-RC_VERSION-env-var}
156 image: rhodecode/app:${RC_VERSION:?specify-RC_VERSION-env-var}
152 stdin_open: true
157 stdin_open: true
153 tty: true
158 tty: true
154 restart: unless-stopped
159 restart: unless-stopped
155 command: [
160 command: [
156 "/var/opt/rhodecode_bin/bin/celery",
161 "/var/opt/rhodecode_bin/bin/celery",
157 "worker",
162 "worker",
158 "--task-events",
163 "--task-events",
159 "--autoscale=10,2",
164 "--autoscale=10,2",
160 "--no-color",
165 "--no-color",
161 "--app=rhodecode.lib.celerylib.loader",
166 "--app=rhodecode.lib.celerylib.loader",
162 "--loglevel=DEBUG",
167 "--loglevel=DEBUG",
163 "--ini=/etc/rhodecode/conf/compose/rhodecode.optimized.ini"
168 "--ini=/etc/rhodecode/conf/compose/rhodecode.optimized.ini"
164 ]
169 ]
165
170
166 environment:
171 environment:
167 RC_APP_TYPE: rhodecode_celery
172 RC_APP_TYPE: rhodecode_celery
168 RC_APP_PROC: 1
173 RC_APP_PROC: 1
169 MAIN_INI_PATH: /etc/rhodecode/conf/compose/rhodecode.optimized.ini
174 MAIN_INI_PATH: /etc/rhodecode/conf/compose/rhodecode.optimized.ini
170 ENV_RC_BASE_URL: ${RHODECODE_BASE_URL}
175 ENV_RC_BASE_URL: ${RHODECODE_BASE_URL}
171 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
176 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
172 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
177 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
173 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
178 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
174
179
175 depends_on:
180 depends_on:
176 - database
181 - database
177 - redis
182 - redis
178
183
179 volumes:
184 volumes:
180 - confvolume:/etc/rhodecode/conf
185 - confvolume:/etc/rhodecode/conf
181 - logvolume:/var/log/rhodecode
186 - logvolume:/var/log/rhodecode
182 - rhodecode_repos:/var/opt/rhodecode_repo_store
187 - rhodecode_repos:/var/opt/rhodecode_repo_store
183 - datavolume:/var/opt/rhodecode_data
188 - datavolume:/var/opt/rhodecode_data
184
189
185 beat:
190 beat:
186 # This service is not scalable
191 # This service is not scalable
187 networks:
192 networks:
188 - rhodecode_network
193 - rhodecode_network
189 image: rhodecode/app:${RC_VERSION:?specify-RC_VERSION-env-var}
194 image: rhodecode/app:${RC_VERSION:?specify-RC_VERSION-env-var}
190 stdin_open: true
195 stdin_open: true
191 tty: true
196 tty: true
192 restart: unless-stopped
197 restart: unless-stopped
193 command: [
198 command: [
194 "/var/opt/rhodecode_bin/bin/celery",
199 "/var/opt/rhodecode_bin/bin/celery",
195 "beat",
200 "beat",
196 "--no-color",
201 "--no-color",
197 "--app=rhodecode.lib.celerylib.loader",
202 "--app=rhodecode.lib.celerylib.loader",
198 "--scheduler=rhodecode.lib.celerylib.scheduler.RcScheduler",
203 "--scheduler=rhodecode.lib.celerylib.scheduler.RcScheduler",
199 "--loglevel=DEBUG",
204 "--loglevel=DEBUG",
200 "--ini=/etc/rhodecode/conf/compose/rhodecode.optimized.ini"
205 "--ini=/etc/rhodecode/conf/compose/rhodecode.optimized.ini"
201 ]
206 ]
202
207
203 environment:
208 environment:
204 RC_APP_TYPE: rhodecode_beat
209 RC_APP_TYPE: rhodecode_beat
205 RC_APP_PROC: 1
210 RC_APP_PROC: 1
206 MAIN_INI_PATH: /etc/rhodecode/conf/compose/rhodecode.optimized.ini
211 MAIN_INI_PATH: /etc/rhodecode/conf/compose/rhodecode.optimized.ini
207 ENV_RC_BASE_URL: ${RHODECODE_BASE_URL}
212 ENV_RC_BASE_URL: ${RHODECODE_BASE_URL}
208 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
213 SSL_CERT_FILE: "/etc/rhodecode/conf/ca-bundle.crt"
209 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
214 REQUESTS_CA_BUNDLE: "/etc/rhodecode/conf/ca-bundle.crt"
210 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
215 GIT_SSL_CAINFO: "/etc/rhodecode/conf/ca-bundle.crt"
211
216
212 depends_on:
217 depends_on:
213 - database
218 - database
214 - redis
219 - redis
215
220
216 volumes:
221 volumes:
217 - confvolume:/etc/rhodecode/conf
222 - confvolume:/etc/rhodecode/conf
218 - logvolume:/var/log/rhodecode
223 - logvolume:/var/log/rhodecode
219 - rhodecode_repos:/var/opt/rhodecode_repo_store
224 - rhodecode_repos:/var/opt/rhodecode_repo_store
220 - datavolume:/var/opt/rhodecode_data
225 - datavolume:/var/opt/rhodecode_data
221
226
222 svn:
227 svn:
223 networks:
228 networks:
224 - rhodecode_network
229 - rhodecode_network
225 image: rhodecode/app:${RC_VERSION:?specify-RC_VERSION-env-var}
230 image: rhodecode/app:${RC_VERSION:?specify-RC_VERSION-env-var}
226 stdin_open: true
231 stdin_open: true
227 tty: true
232 tty: true
228 restart: unless-stopped
233 restart: unless-stopped
229 command: ["apachectl", "-D", "FOREGROUND"]
234 command: ["apachectl", "-D", "FOREGROUND"]
230
235
231 environment:
236 environment:
232 RC_APP_TYPE: rhodecode_svn
237 RC_APP_TYPE: rhodecode_svn
233
238
234 # SVN Specific
239 # SVN Specific
235 MOD_DAV_SVN_PORT: 8090
240 MOD_DAV_SVN_PORT: 8090
236 APACHE_LOG_DIR: /var/log/rhodecode/svn
241 APACHE_LOG_DIR: /var/log/rhodecode/svn
237 MOD_DAV_SVN_CONF_FILE: /etc/rhodecode/conf/svn/mod_dav_svn.conf
242 MOD_DAV_SVN_CONF_FILE: /etc/rhodecode/conf/svn/mod_dav_svn.conf
238
243
239 ports:
244 ports:
240 - "127.0.0.1::8090"
245 - "127.0.0.1::8090"
241
246
242 healthcheck:
247 healthcheck:
243 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:8090/_server_status" ]
248 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:8090/_server_status" ]
244 timeout: 30s
249 timeout: 30s
245 interval: 60s
250 interval: 60s
246 retries: 10
251 retries: 10
247
252
248 volumes:
253 volumes:
249 - confvolume:/etc/rhodecode/conf
254 - confvolume:/etc/rhodecode/conf
250 - logvolume:/var/log/rhodecode
255 - logvolume:/var/log/rhodecode
251 - rhodecode_repos:/var/opt/rhodecode_repo_store
256 - rhodecode_repos:/var/opt/rhodecode_repo_store
252
257
253 sshd:
258 sshd:
254 networks:
259 networks:
255 - rhodecode_network
260 - rhodecode_network
256 image: rhodecode/app:${RC_VERSION:?specify-RC_VERSION-env-var}
261 image: rhodecode/app:${RC_VERSION:?specify-RC_VERSION-env-var}
257 stdin_open: true
262 stdin_open: true
258 tty: true
263 tty: true
259 restart: unless-stopped
264 restart: unless-stopped
260 command: ["/usr/sbin/sshd", "-f", "/etc/rhodecode/sshd_config", "-D", "-e"]
265 command: ["/usr/sbin/sshd", "-f", "/etc/rhodecode/sshd_config", "-D", "-e"]
261
266
262 environment:
267 environment:
263 RC_APP_TYPE: rhodecode_sshd
268 RC_APP_TYPE: rhodecode_sshd
264 SSH_BOOTSTRAP: 1
269 SSH_BOOTSTRAP: 1
265
270
266 ports:
271 ports:
267 # set from .env file
272 # set from .env file
268 - "${RC_SSH_PORT:?must-specify-ssh-port}:22"
273 - "${RC_SSH_PORT:?must-specify-ssh-port}:22"
269
274
270 depends_on: {}
275 depends_on: {}
271
276
272 volumes:
277 volumes:
273 - confvolume:/etc/rhodecode/conf
278 - confvolume:/etc/rhodecode/conf
274 - logvolume:/var/log/rhodecode
279 - logvolume:/var/log/rhodecode
275 - rhodecode_repos:/var/opt/rhodecode_repo_store
280 - rhodecode_repos:/var/opt/rhodecode_repo_store
276 - datavolume:/var/opt/rhodecode_data
281 - datavolume:/var/opt/rhodecode_data
277
282
278 elasticsearch:
283 elasticsearch:
279 networks:
284 networks:
280 - rhodecode_network
285 - rhodecode_network
281 image: docker.elastic.co/elasticsearch/elasticsearch:6.8.13
286 image: docker.elastic.co/elasticsearch/elasticsearch:6.8.14
282
287
283 environment:
288 environment:
284 - cluster.name=elasticsearch-cluster
289 - cluster.name=elasticsearch-cluster
285 - network.host=0.0.0.0
290 - network.host=0.0.0.0
286 - bootstrap.memory_lock=true
291 - bootstrap.memory_lock=true
287 - discovery.type=single-node
292 - discovery.type=single-node
288 - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
293 - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
289
294
290 ulimits:
295 ulimits:
291 memlock:
296 memlock:
292 soft: -1
297 soft: -1
293 hard: -1
298 hard: -1
294
299
295 volumes:
300 volumes:
296 - es_data:/usr/share/elasticsearch/data
301 - es_data:/usr/share/elasticsearch/data
297
302
298 channelstream:
303 channelstream:
299 networks:
304 networks:
300 - rhodecode_network
305 - rhodecode_network
301 image: channelstream/channelstream:0.7.1
306 image: channelstream/channelstream:0.7.1
302 restart: unless-stopped
307 restart: unless-stopped
303
308
304 ports:
309 ports:
305 - "127.0.0.1:9800:9800"
310 - "127.0.0.1:9800:9800"
306
311
307 command: ["channelstream", "-i", "/etc/rhodecode/conf/compose/channelstream.ini"]
312 command: ["channelstream", "-i", "/etc/rhodecode/conf/compose/channelstream.ini"]
308
313
309 environment:
314 environment:
310 CHANNELSTREAM_ALLOW_POSTING_FROM: 0.0.0.0
315 CHANNELSTREAM_ALLOW_POSTING_FROM: 0.0.0.0
311
316
312 healthcheck:
317 healthcheck:
313 test: [ "CMD", "curl", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:9800/admin/sign_in" ]
318 test: [ "CMD", "curl", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:9800/admin/sign_in" ]
314 timeout: 30s
319 timeout: 30s
315 interval: 60s
320 interval: 60s
316 retries: 10
321 retries: 10
317
322
318 volumes:
323 volumes:
319 - confvolume:/etc/rhodecode/conf
324 - confvolume:/etc/rhodecode/conf
320 - logvolume:/var/log/rhodecode
325 - logvolume:/var/log/rhodecode
321
326
322 redis:
327 redis:
323 networks:
328 networks:
324 - rhodecode_network
329 - rhodecode_network
325 image: rhodecode/redis:6.0.10
330 image: rhodecode/redis:6.2.1
331
326 build:
332 build:
327 context: .
333 context: .
328 dockerfile: service/redis/rhodecode_redis.dockerfile
334 dockerfile: service/redis/rhodecode_redis.dockerfile
329 network: rhodecode_network
335 network: rhodecode_network
336 args:
337 REDIS_BUILD: 6.2.1
330
338
331 restart: unless-stopped
339 restart: unless-stopped
332
340
333 ports:
341 ports:
334 - "127.0.0.1::6379"
342 - "127.0.0.1::6379"
335
343
336 volumes:
344 volumes:
337 - logvolume:/var/log/rhodecode
345 - logvolume:/var/log/rhodecode
338
346
339 database:
347 database:
340 networks:
348 networks:
341 - rhodecode_network
349 - rhodecode_network
342 image: rhodecode/database:13.1
350 image: rhodecode/database:13.2
351
343 build:
352 build:
344 context: .
353 context: .
345 dockerfile: service/database/rhodecode_database.dockerfile
354 dockerfile: service/database/rhodecode_database.dockerfile
346 network: rhodecode_network
355 network: rhodecode_network
347 restart: unless-stopped
356 args:
348
357 POSTGRES_BUILD: 13.2
349 ports:
350 - "127.0.0.1::5432"
351
358
352 environment:
359 environment:
353 POSTGRES_DB: ${POSTGRES_DB:?must-specify-db-name}
360 POSTGRES_DB: ${POSTGRES_DB:?must-specify-db-name}
354 POSTGRES_USER: rhodecode
361 POSTGRES_USER: ${POSTGRES_USER:?must-specify-db-user}
355 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?must-specify-db-password}
362 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?must-specify-db-password}
356
363
364 restart: unless-stopped
365
366 ports:
367 - "127.0.0.1::5432"
368
357 volumes:
369 volumes:
358 # save the pg_data volume
370 # save the pg_data volume
359 - pg_data:/var/lib/postgresql/data
371 - pg_data:/var/lib/postgresql/data
360 - logvolume:/var/log/rhodecode
372 - logvolume:/var/log/rhodecode
361
373
362 nginx:
374 nginx:
363 networks:
375 networks:
364 - rhodecode_network
376 - rhodecode_network
365 image: rhodecode/nginx:1.19.6
377 image: rhodecode/nginx:1.19.8
378
366 build:
379 build:
367 context: .
380 context: .
368 dockerfile: service/nginx/rhodecode_nginx.dockerfile
381 dockerfile: service/nginx/rhodecode_nginx.dockerfile
369 network: rhodecode_network
382 network: rhodecode_network
383 args:
384 NGINX_BUILD: 1.19.8
385
370 restart: unless-stopped
386 restart: unless-stopped
371
387
372 ports:
388 ports:
373 # set from .env file
389 # set from .env file
374 - "${RC_HTTP_PORT:?must-specify-http-port}:80"
390 - "${RC_HTTP_PORT:?must-specify-http-port}:80"
375 - "${RC_HTTPS_PORT:?must-specify-https-port}:443"
391 - "${RC_HTTPS_PORT:?must-specify-https-port}:443"
376
392
377 healthcheck:
393 healthcheck:
378 # change port 80 to 443 when only using SSL
394 # change port 80 to 443 when only using SSL
379 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:80/_admin/ops/ping" ]
395 test: [ "CMD", "curl", "-A", "RhodeCode-Healthcheck", "-s", "-o", "/dev/null", "-w", "'%{http_code}'", "http://127.0.0.1:80/_admin/ops/ping" ]
380 timeout: 30s
396 timeout: 30s
381 interval: 60s
397 interval: 60s
382 retries: 10
398 retries: 10
383
399
384 depends_on:
400 depends_on:
385 - channelstream
401 - channelstream
386
402
387 volumes:
403 volumes:
388 - confvolume:/etc/rhodecode/conf
404 - confvolume:/etc/rhodecode/conf
389 - logvolume:/var/log/rhodecode
405 - logvolume:/var/log/rhodecode
390
406
391 volumes_from:
407 volumes_from:
392 - rhodecode:ro
408 - rhodecode:ro
@@ -1,4 +1,5 b''
1 FROM library/postgres:13.1
1 ARG POSTGRES_BUILD
2 FROM library/postgres:$POSTGRES_BUILD
2
3
3 COPY service/database/customized.conf /etc/conf.d/pg_customized.conf
4 COPY service/database/customized.conf /etc/conf.d/pg_customized.conf
4 CMD ["postgres", "-c", "log_statement=ddl"] No newline at end of file
5 CMD ["postgres", "-c", "log_statement=ddl"]
@@ -1,13 +1,14 b''
1 FROM library/nginx:1.19.6
1 ARG NGINX_BUILD
2 FROM library/nginx:$NGINX_BUILD
2
3
3 ENV NGINX_ENTRYPOINT_QUIET_LOGS=1
4 ENV NGINX_ENTRYPOINT_QUIET_LOGS=1
4
5
5 RUN mkdir -p /etc/nginx/sites-enabled/
6 RUN mkdir -p /etc/nginx/sites-enabled/
6 RUN mkdir -p /var/log/rhodecode/nginx
7 RUN mkdir -p /var/log/rhodecode/nginx
7 COPY service/nginx/nginx.conf /etc/nginx/nginx.conf
8 COPY service/nginx/nginx.conf /etc/nginx/nginx.conf
8 COPY service/nginx/http.conf /etc/nginx/sites-enabled/http.conf
9 COPY service/nginx/http.conf /etc/nginx/sites-enabled/http.conf
9 COPY service/nginx/proxy.conf /etc/nginx/proxy.conf
10 COPY service/nginx/proxy.conf /etc/nginx/proxy.conf
10
11
11 VOLUME /var/log/rhodecode
12 VOLUME /var/log/rhodecode
12
13
13 #TODO enable amplify No newline at end of file
14 #TODO enable amplify
@@ -1,3 +1,4 b''
1 FROM library/redis:6.0.9
1 ARG REDIS_BUILD
2 FROM library/redis:$REDIS_BUILD
2 COPY service/redis/redis.conf /etc/redis/redis-rc.conf
3 COPY service/redis/redis.conf /etc/redis/redis-rc.conf
3 CMD ["redis-server", "/etc/redis/redis-rc.conf"]
4 CMD ["redis-server", "/etc/redis/redis-rc.conf"]
@@ -1,245 +1,254 b''
1 FROM ubuntu:groovy
1 FROM ubuntu:groovy
2 MAINTAINER RhodeCode Inc. <support@rhodecode.com>
2 MAINTAINER RhodeCode Inc. <support@rhodecode.com>
3
3
4 ARG TZ="UTC"
4 ARG TZ="UTC"
5 ARG LOCALE_TYPE=en_US.UTF-8
5 ARG LOCALE_TYPE=en_US.UTF-8
6 ARG RHODECODE_TYPE=Enterprise
6 ARG RHODECODE_TYPE=Enterprise
7 # binary-install
7 ARG RHODECODE_VERSION=4.24.1
8 ARG RHODECODE_VERSION=4.24.1
9
8 ARG RHODECODE_DB=sqlite
10 ARG RHODECODE_DB=sqlite
9 ARG RHODECODE_USER_NAME=admin
11 ARG RHODECODE_USER_NAME=admin
10 ARG RHODECODE_USER_PASS=secret4
12 ARG RHODECODE_USER_PASS=secret4
11 ARG RHODECODE_USER_EMAIL=support@rhodecode.com
13 ARG RHODECODE_USER_EMAIL=support@rhodecode.com
12
14
13 # env are runtime
15 # env are runtime
14 ENV \
16 ENV \
15 TZ=${TZ} \
17 TZ=${TZ} \
16 LOCALE_TYPE=${LOCALE_TYPE} \
18 LOCALE_TYPE=${LOCALE_TYPE} \
17 \
19 \
18 ## Define type we build, and the instance we'll create
20 ## Define type we build, and the instance we'll create
19 RHODECODE_TYPE=${RHODECODE_TYPE} \
21 RHODECODE_TYPE=${RHODECODE_TYPE} \
20 RC_TYPE_ID=enterprise-1 \
22 RC_TYPE_ID=enterprise-1 \
21 \
23 \
22 ## SETUP ARGS FOR INSTALLATION ##
24 ## SETUP ARGS FOR INSTALLATION ##
23 ## set version we build on, get from .env or set default ver
25 ## set version we build on, get from .env or set default ver
24 RHODECODE_VERSION=${RHODECODE_VERSION} \
26 RHODECODE_VERSION=${RHODECODE_VERSION} \
25 \
27 \
26 ## set DB, default sqlite
28 ## set DB, default sqlite
27 RHODECODE_DB=${RHODECODE_DB} \
29 RHODECODE_DB=${RHODECODE_DB} \
28 \
30 \
29 ## set app bootstrap required data
31 ## set app bootstrap required data
30 RHODECODE_USER_NAME=${RHODECODE_USER_NAME} \
32 RHODECODE_USER_NAME=${RHODECODE_USER_NAME} \
31 RHODECODE_USER_PASS=${RHODECODE_USER_PASS} \
33 RHODECODE_USER_PASS=${RHODECODE_USER_PASS} \
32 RHODECODE_USER_EMAIL=${RHODECODE_USER_EMAIL} \
34 RHODECODE_USER_EMAIL=${RHODECODE_USER_EMAIL} \
33 \
35 \
34 RC_USER=rhodecode \
36 RC_USER=rhodecode \
35 \
37 \
36 # SVN CONFIG
38 # SVN CONFIG
37 MOD_DAV_SVN_CONF_FILE=/etc/rhodecode/conf/svn/mod_dav_svn.conf \
39 MOD_DAV_SVN_CONF_FILE=/etc/rhodecode/conf/svn/mod_dav_svn.conf \
38 MOD_DAV_SVN_PORT=8090 \
40 MOD_DAV_SVN_PORT=8090 \
39 \
41 \
40 # SSHD CONFIG
42 # SSHD CONFIG
41 SSHD_CONF_FILE=/etc/rhodecode/sshd_config \
43 SSHD_CONF_FILE=/etc/rhodecode/sshd_config \
42 \
44 \
43 BUILD_CONF=/etc/rhodecode/conf_build \
45 BUILD_CONF=/etc/rhodecode/conf_build \
44 BUILD_BIN_DIR=/var/opt/rhodecode_bin \
46 BUILD_BIN_DIR=/var/opt/rhodecode_bin \
45 RHODECODE_DATA_DIR=/var/opt/rhodecode_data \
47 RHODECODE_DATA_DIR=/var/opt/rhodecode_data \
46 RHODECODE_REPO_DIR=/var/opt/rhodecode_repo_store \
48 RHODECODE_REPO_DIR=/var/opt/rhodecode_repo_store \
47 RHODECODE_HTTP_PORT=10020 \
49 RHODECODE_HTTP_PORT=10020 \
48 RHODECODE_VCS_PORT=10010 \
50 RHODECODE_VCS_PORT=10010 \
49 RHODECODE_HOST=0.0.0.0 \
51 RHODECODE_HOST=0.0.0.0 \
50 RHODECODE_VCS_HOST=127.0.0.1
52 RHODECODE_VCS_HOST=127.0.0.1
51
53
52 ENV \
54 ENV \
53 RCCONTROL=/home/$RC_USER/.rccontrol-profile/bin/rccontrol \
55 RCCONTROL=/home/$RC_USER/.rccontrol-profile/bin/rccontrol \
54 SUPERVISOR_CONF=/home/$RC_USER/.rccontrol/supervisor/supervisord.ini \
56 SUPERVISOR_CONF=/home/$RC_USER/.rccontrol/supervisor/supervisord.ini \
55 # make application scripts visible
57 # make application scripts visible
56 PATH=$PATH:/home/$RC_USER/.rccontrol-profile/bin
58 PATH=$PATH:/home/$RC_USER/.rccontrol-profile/bin
57
59
58 ENV SVN_LOCALE_DEPS apache2 apache2-utils libapache2-mod-svn
60 ENV SVN_LOCALE_DEPS apache2 apache2-utils libapache2-mod-svn
59 ENV SSH_LOCALE_DEPS openssh-server
61 ENV SSH_LOCALE_DEPS openssh-server
60 ENV PYTHON_DEPS python2
62 ENV PYTHON_DEPS python2
61
63
62 RUN \
64 RUN \
63 echo "** install base packages **" && \
65 echo "** install base packages **" && \
64 set -eux; \
66 set -eux; \
65 \
67 \
66 savedAptMark="$(apt-mark showmanual)"; \
68 savedAptMark="$(apt-mark showmanual)"; \
67 apt-get update; \
69 apt-get update; \
68 DEBIAN_FRONTEND="noninteractive" \
70 DEBIAN_FRONTEND="noninteractive" \
69 apt-get install -y --no-install-recommends \
71 apt-get install -y --no-install-recommends \
70 tini \
72 tini \
71 bash \
73 bash \
72 binutils \
74 binutils \
73 tzdata \
75 tzdata \
74 locales \
76 locales \
75 openssl \
77 openssl \
76 curl \
78 curl \
77 sudo \
79 sudo \
78 gosu \
80 gosu \
81 bzip2 \
82 ca-certificates \
79 $PYTHON_DEPS \
83 $PYTHON_DEPS \
80 $SSH_LOCALE_DEPS \
84 $SSH_LOCALE_DEPS \
81 $SVN_LOCALE_DEPS \
85 $SVN_LOCALE_DEPS \
82 ; \
86 ; \
83 rm -rf /var/lib/apt/lists/*;
87 rm -rf /var/lib/apt/lists/*;
84
88
85 RUN \
89 RUN \
86 echo "** Configure the python executable for py2/3 compat **" && \
90 echo "** Configure the python executable for py2/3 compat **" && \
87 ISPY=$(which python3 || which python2) && \
91 ISPY=$(which python3 || which python2) && \
88 if [ -n $ISPY ] ; then ln -s $ISPY /usr/bin/python ; fi
92 if [ -n $ISPY ] ; then ln -s $ISPY /usr/bin/python ; fi
89
93
90 RUN \
94 RUN \
91 echo "** Configure the locales **" && \
95 echo "** Configure the locales **" && \
92 sed -i "s/^# ${LOCALE_TYPE}/${LOCALE_TYPE}/g" /etc/locale.gen && \
96 sed -i "s/^# ${LOCALE_TYPE}/${LOCALE_TYPE}/g" /etc/locale.gen && \
93 locale-gen
97 locale-gen
94
98
95 # locale-archive is a fix for old nix glibc2.26 locales available
99 # locale-archive is a fix for old nix glibc2.26 locales available
96 ENV \
100 ENV \
97 LOCALE_ARCHIVE=/var/opt/locale-archive \
101 LOCALE_ARCHIVE=/var/opt/locale-archive \
98 LANG=${LOCALE_TYPE} \
102 LANG=${LOCALE_TYPE} \
99 LANGUAGE=${LOCALE_TYPE} \
103 LANGUAGE=${LOCALE_TYPE} \
100 LC_ALL=${LOCALE_TYPE}
104 LC_ALL=${LOCALE_TYPE}
101
105
102 # configure the system user
106 # configure the system user
103 # explicitly set uid/gid to guarantee that it won't change in the future
107 # explicitly set uid/gid to guarantee that it won't change in the future
104 # the values 999:999 are identical to the current user/group id assigned
108 # the values 999:999 are identical to the current user/group id assigned
105 RUN \
109 RUN \
106 echo "** Create system user $RC_USER **" && \
110 echo "** Create system user $RC_USER **" && \
107 groupadd --system --gid 999 $RC_USER && \
111 groupadd --system --gid 999 $RC_USER && \
108 useradd --system --gid $RC_USER --uid 999 --shell /bin/bash $RC_USER
112 useradd --system --gid $RC_USER --uid 999 --shell /bin/bash $RC_USER && \
113 usermod -G $RC_USER $RC_USER
109
114
110 # set the defult bash shell
115 # set the defult bash shell
111 SHELL ["/bin/bash", "-c"]
116 SHELL ["/bin/bash", "-c"]
112
117
113 # Fix and set a timezone
118 # Fix and set a timezone
114 RUN \
119 RUN \
115 echo "** configure the timezone **" && \
120 echo "** configure the timezone **" && \
116 rm /etc/localtime && cp /usr/share/zoneinfo/$TZ /etc/localtime && \
121 rm /etc/localtime && cp /usr/share/zoneinfo/$TZ /etc/localtime && \
117 echo $TZ > /etc/timezone
122 echo $TZ > /etc/timezone
118
123
119
124
120 RUN \
125 RUN \
121 echo "** prepare rhodecode store and cache **" && \
126 echo "** prepare rhodecode store and cache **" && \
127 install -d -m 0700 -o $RC_USER -g $RC_USER /nix && \
122 install -d -m 0755 -o $RC_USER -g $RC_USER /opt/rhodecode && \
128 install -d -m 0755 -o $RC_USER -g $RC_USER /opt/rhodecode && \
123 install -d -m 0755 -o $RC_USER -g $RC_USER /var/opt/rhodecode_bin && \
129 install -d -m 0755 -o $RC_USER -g $RC_USER /var/opt/rhodecode_bin && \
124 install -d -m 0755 -o $RC_USER -g $RC_USER $RHODECODE_REPO_DIR && \
130 install -d -m 0755 -o $RC_USER -g $RC_USER $RHODECODE_REPO_DIR && \
125 install -d -m 0755 -o $RC_USER -g $RC_USER $RHODECODE_DATA_DIR && \
131 install -d -m 0755 -o $RC_USER -g $RC_USER $RHODECODE_DATA_DIR && \
126 install -d -m 0755 -o $RC_USER -g $RC_USER $BUILD_CONF && \
132 install -d -m 0755 -o $RC_USER -g $RC_USER $BUILD_CONF && \
127 install -d -m 0755 -o $RC_USER -g $RC_USER /home/$RC_USER/ && \
133 install -d -m 0755 -o $RC_USER -g $RC_USER /home/$RC_USER/ && \
128 install -d -m 0755 -o $RC_USER -g $RC_USER /home/$RC_USER/.rccontrol && \
134 install -d -m 0755 -o $RC_USER -g $RC_USER /home/$RC_USER/.rccontrol && \
129 install -d -m 0755 -o $RC_USER -g $RC_USER /home/$RC_USER/.rccontrol/cache && \
135 install -d -m 0755 -o $RC_USER -g $RC_USER /home/$RC_USER/.rccontrol/cache && \
130 install -d -m 0755 -o $RC_USER -g $RC_USER /home/$RC_USER/.rccontrol/bootstrap && \
136 install -d -m 0755 -o $RC_USER -g $RC_USER /home/$RC_USER/.rccontrol/bootstrap && \
131 install -d -m 0700 -o $RC_USER -g $RC_USER /home/$RC_USER/.ssh && \
137 install -d -m 0700 -o $RC_USER -g $RC_USER /home/$RC_USER/.ssh && \
132 install -d -m 0700 -o $RC_USER -g $RC_USER /home/$RC_USER/.rhoderc
138 install -d -m 0700 -o $RC_USER -g $RC_USER /home/$RC_USER/.rhoderc
133
139
134 # expose our custom sshd config
140 # expose our custom sshd config
135 COPY service/sshd/sshd_config $SSHD_CONF_FILE
141 COPY service/sshd/sshd_config $SSHD_CONF_FILE
136
142
137 # Apache SVN setup
143 # Apache SVN setup
138 RUN \
144 RUN \
139 echo "**** Apache config cleanup ****" && \
145 echo "**** Apache config cleanup ****" && \
140 rm -f /etc/apache2/conf.d/info.conf \
146 rm -f /etc/apache2/conf.d/info.conf \
141 /etc/apache2/conf.d/mpm.conf \
147 /etc/apache2/conf.d/mpm.conf \
142 /etc/apache2/conf.d/userdir.conf && \
148 /etc/apache2/conf.d/userdir.conf && \
143 rm -f /etc/apache2/sites-enabled/* && \
149 rm -f /etc/apache2/sites-enabled/* && \
144 rm -f /etc/apache2/sites-available/*
150 rm -f /etc/apache2/sites-available/*
145
151
146 # custom SVN virtualhost
152 # custom SVN virtualhost
147 COPY service/svn/virtualhost.conf /etc/apache2/sites-enabled/
153 COPY service/svn/virtualhost.conf /etc/apache2/sites-enabled/
148
154
149 RUN \
155 RUN \
150 echo "**** Apache config ****" && \
156 echo "**** Apache config ****" && \
151 echo $(strings /usr/lib/apache2/modules/mod_dav_svn.so | grep 'Powered by') > /var/opt/dav.version && \
157 echo $(strings /usr/lib/apache2/modules/mod_dav_svn.so | grep 'Powered by') > /var/opt/dav.version && \
152 mkdir -p /run/apache2 && \
158 mkdir -p /run/apache2 && \
153 mkdir -p /var/opt/www && \
159 mkdir -p /var/opt/www && \
154 echo "unset HOME" > /etc/apache2/envvars && \
160 echo "unset HOME" > /etc/apache2/envvars && \
155 echo "export APACHE_RUN_USER=${RC_USER}" >> /etc/apache2/envvars && \
161 echo "export APACHE_RUN_USER=${RC_USER}" >> /etc/apache2/envvars && \
156 echo "export APACHE_PID_FILE=/var/run/apache2/apache2.pid" >> /etc/apache2/envvars && \
162 echo "export APACHE_PID_FILE=/var/run/apache2/apache2.pid" >> /etc/apache2/envvars && \
157 echo "export APACHE_RUN_DIR=/var/run/apache2" >> /etc/apache2/envvars && \
163 echo "export APACHE_RUN_DIR=/var/run/apache2" >> /etc/apache2/envvars && \
158 echo "export APACHE_LOCK_DIR=/var/lock/apache2" >> /etc/apache2/envvars && \
164 echo "export APACHE_LOCK_DIR=/var/lock/apache2" >> /etc/apache2/envvars && \
159 echo "export APACHE_RUN_USER=${RC_USER}" >> /etc/apache2/envvars && \
165 echo "export APACHE_RUN_USER=${RC_USER}" >> /etc/apache2/envvars && \
160 echo "export APACHE_RUN_GROUP=${RC_USER}" >> /etc/apache2/envvars && \
166 echo "export APACHE_RUN_GROUP=${RC_USER}" >> /etc/apache2/envvars && \
161 sed -i "s/Listen 80/Listen ${MOD_DAV_SVN_PORT}/g" /etc/apache2/ports.conf
167 sed -i "s/Listen 80/Listen ${MOD_DAV_SVN_PORT}/g" /etc/apache2/ports.conf
162
168
163
169
164 # Copy artifacts
170 # Copy artifacts
165 COPY --chown=$RC_USER:$RC_USER .cache/* /home/$RC_USER/.rccontrol/cache/
171 COPY --chown=$RC_USER:$RC_USER .cache/* /home/$RC_USER/.rccontrol/cache/
166 COPY --chown=$RC_USER:$RC_USER service/rhodecode/bootstrap/* /home/$RC_USER/.rccontrol/bootstrap/
167 COPY --chown=$RC_USER:$RC_USER config/compose/rhodecode_enterprise.license /home/$RC_USER/.rccontrol/bootstrap/
172 COPY --chown=$RC_USER:$RC_USER config/compose/rhodecode_enterprise.license /home/$RC_USER/.rccontrol/bootstrap/
173 COPY --chown=$RC_USER:$RC_USER service/rhodecode/bootstrap/* /home/$RC_USER/.rccontrol/bootstrap/
168
174
169 RUN \
175 RUN \
170 echo "**** locale-archive path ****" && \
176 echo "**** locale-archive path ****" && \
171 mv -v /home/$RC_USER/.rccontrol/cache/locale-archive /var/opt/locale-archive
177 mv -v /home/$RC_USER/.rccontrol/cache/locale-archive /var/opt/locale-archive
172
178
173 # change to non-root user for RUN commands
179 # change to non-root user for RUN commands
174 USER $RC_USER
180 USER $RC_USER
175 WORKDIR /home/$RC_USER
181 WORKDIR /home/$RC_USER
176
182
177 RUN \
183 RUN \
178 echo "** install rhodecode control **" && \
184 echo "** install rhodecode control **" && \
179 cd /home/$RC_USER/.rccontrol/cache && \
185 cd /home/$RC_USER/.rccontrol/cache && \
180 INSTALLER=$(ls -Art /home/$RC_USER/.rccontrol/cache/RhodeCode-installer-* | tail -n 1) && \
186 INSTALLER=$(ls -Art /home/$RC_USER/.rccontrol/cache/RhodeCode-installer-* | tail -n 1) && \
181 chmod +x ${INSTALLER} && \
187 chmod +x ${INSTALLER} && \
182 ${INSTALLER} --accept-license && \
188 ${INSTALLER} --accept-license && \
183 ${RCCONTROL} self-init && \
189 ${RCCONTROL} self-init && \
184 cp -v /home/$RC_USER/.rccontrol-profile/etc/ca-bundle.crt $BUILD_CONF/
190 cp -v /home/$RC_USER/.rccontrol-profile/etc/ca-bundle.crt $BUILD_CONF/ && \
191 echo "Done"
185
192
186 RUN \
193 RUN \
187 echo "** install vcsserver ${RHODECODE_VERSION} **" && \
194 echo "** install vcsserver ${RHODECODE_VERSION} **" && \
188 ${RCCONTROL} install VCSServer --version ${RHODECODE_VERSION} --start-at-boot=yes --accept-license --offline \
195 ${RCCONTROL} install VCSServer --version ${RHODECODE_VERSION} --start-at-boot=yes --accept-license --offline \
189 '{"host":"'"$RHODECODE_VCS_HOST"'", "port":"'"$RHODECODE_VCS_PORT"'"}' && \
196 '{"host":"'"$RHODECODE_VCS_HOST"'", "port":"'"$RHODECODE_VCS_PORT"'"}' && \
190 VCSSERVER_PATH=/home/$RC_USER/.rccontrol/vcsserver-1 && \
197 VCSSERVER_PATH=/home/$RC_USER/.rccontrol/vcsserver-1 && \
191 cp -v ${VCSSERVER_PATH}/vcsserver.ini $BUILD_CONF/
198 rm -rf $BUILD_BIN_DIR/vcs_bin && ln -s ${VCSSERVER_PATH}/profile/bin $BUILD_BIN_DIR/vcs_bin && \
199 cp -v ${VCSSERVER_PATH}/vcsserver.ini $BUILD_CONF/vcsserver.ini
192
200
193 RUN \
201 RUN \
194 echo "** install rhodecode ${RHODECODE_TYPE} ${RHODECODE_VERSION} **" && \
202 echo "** install rhodecode ${RHODECODE_TYPE} ${RHODECODE_VERSION} **" && \
195 RHODECODE_DB_INIT=sqlite && \
203 RHODECODE_DB_INIT=sqlite && \
196 ${RCCONTROL} install ${RHODECODE_TYPE} --version ${RHODECODE_VERSION} --start-at-boot=yes --accept-license --offline \
204 ${RCCONTROL} install ${RHODECODE_TYPE} --version ${RHODECODE_VERSION} --start-at-boot=yes --accept-license --offline \
197 '{"host":"'"$RHODECODE_HOST"'", "port":"'"$RHODECODE_HTTP_PORT"'", "username":"'"$RHODECODE_USER_NAME"'", "password":"'"$RHODECODE_USER_PASS"'", "email":"'"$RHODECODE_USER_EMAIL"'", "repo_dir":"'"$RHODECODE_REPO_DIR"'", "database": "'"$RHODECODE_DB_INIT"'", "skip_existing_db": "1"}' && \
205 '{"host":"'"$RHODECODE_HOST"'", "port":"'"$RHODECODE_HTTP_PORT"'", "username":"'"$RHODECODE_USER_NAME"'", "password":"'"$RHODECODE_USER_PASS"'", "email":"'"$RHODECODE_USER_EMAIL"'", "repo_dir":"'"$RHODECODE_REPO_DIR"'", "database": "'"$RHODECODE_DB_INIT"'", "skip_existing_db": "1"}' && \
198 RHODECODE_PATH=/home/$RC_USER/.rccontrol/${RC_TYPE_ID} && \
206 RHODECODE_PATH=/home/$RC_USER/.rccontrol/${RC_TYPE_ID} && \
199 cp -v ${RHODECODE_PATH}/rhodecode.ini $BUILD_CONF/ && \
207 rm -rf $BUILD_BIN_DIR/bin && ln -s ${RHODECODE_PATH}/profile/bin $BUILD_BIN_DIR/ && \
200 cp -v ${RHODECODE_PATH}/search_mapping.ini $BUILD_CONF/ && \
208 cp -v ${RHODECODE_PATH}/rhodecode.ini $BUILD_CONF/rhodecode.ini && \
201 cp -v ${RHODECODE_PATH}/gunicorn_conf.py $BUILD_CONF/ && \
209 cp -v ${RHODECODE_PATH}/gunicorn_conf.py $BUILD_CONF/gunicorn_conf.py && \
202 rm -rf $BUILD_BIN_DIR/bin && ln -s ${RHODECODE_PATH}/profile/bin $BUILD_BIN_DIR && \
210 cp -v ${RHODECODE_PATH}/search_mapping.ini $BUILD_CONF/search_mapping.ini && \
203 mkdir -p $RHODECODE_DATA_DIR/static && cp -r ${RHODECODE_PATH}/public/* $RHODECODE_DATA_DIR/static/ && \
211 mkdir -p $RHODECODE_DATA_DIR/static && cp -r ${RHODECODE_PATH}/public/* $RHODECODE_DATA_DIR/static/ && \
204 rm ${RHODECODE_PATH}/rhodecode.db
212 rm ${RHODECODE_PATH}/rhodecode.db
205
213
206
214
207 RUN \
215 RUN \
208 echo "** configure supervisord **" && \
216 echo "** configure supervisord **" && \
209 cp -v ${SUPERVISOR_CONF} $BUILD_CONF/ && \
217 cp -v ${SUPERVISOR_CONF} $BUILD_CONF/ && \
210 sed -i "s/self_managed_supervisor = False/self_managed_supervisor = True/g" /home/$RC_USER/.rccontrol.ini
218 sed -i "s/self_managed_supervisor = False/self_managed_supervisor = True/g" /home/$RC_USER/.rccontrol.ini && \
219 echo "done"
211
220
212 USER root
221 USER root
213
222
214
223
215 RUN \
224 RUN \
216 echo "**** cleanup ****" && \
225 echo "**** cleanup ****" && \
217 apt-get remove -y $PYTHON_DEPS && \
226 apt-get remove -y $PYTHON_DEPS && \
218 apt-get autoclean -y && \
227 apt-get autoclean -y && \
219 rm -f /tmp/* && \
228 rm -f /tmp/* && \
220 rm -f /home/$RC_USER/.rccontrol/cache/RhodeCode-installer-* && \
229 rm -f /home/$RC_USER/.rccontrol/cache/RhodeCode-installer-* && \
221 rm -f /home/$RC_USER/.rccontrol/cache/*.bz2 && \
230 rm -f /home/$RC_USER/.rccontrol/cache/*.bz2 && \
222 rm -rf /var/lib/apt/lists/* \
231 rm -rf /var/lib/apt/lists/* \
223 rm -rf /var/cache/apk/* \
232 rm -rf /var/cache/apk/* \
224 rm ${SUPERVISOR_CONF}
233 rm ${SUPERVISOR_CONF}
225
234
226 # copy entrypoints
235 # copy entrypoints
227 COPY entrypoints.d/entrypoint.sh /opt/entrypoints.d/entrypoint.sh
236 COPY entrypoints.d/entrypoint.sh /opt/entrypoints.d/entrypoint.sh
228 RUN chmod +x /opt/entrypoints.d/entrypoint.sh
237 RUN chmod +x /opt/entrypoints.d/entrypoint.sh
229
238
230 # config volume
239 # config volume
231 VOLUME /etc/rhodecode/conf
240 VOLUME /etc/rhodecode/conf
232
241
233 # repo store volume
242 # repo store volume
234 VOLUME /var/opt/rhodecode_repo_store
243 VOLUME /var/opt/rhodecode_repo_store
235
244
236 # data volume
245 # data volume
237 VOLUME /var/opt/rhodecode_data
246 VOLUME /var/opt/rhodecode_data
238
247
239 # logs volume
248 # logs volume
240 VOLUME /var/log/rhodecode
249 VOLUME /var/log/rhodecode
241
250
242 ENTRYPOINT ["/opt/entrypoints.d/entrypoint.sh"]
251 ENTRYPOINT ["/opt/entrypoints.d/entrypoint.sh"]
243
252
244 # compose can override this
253 # compose can override this
245 CMD ["supervisord", "--nodaemon", "-c", "/etc/rhodecode/conf/supervisord.ini"]
254 CMD ["supervisord", "--nodaemon", "-c", "/etc/rhodecode/conf/supervisord.ini"]
General Comments 0
You need to be logged in to leave comments. Login now