##// END OF EJS Templates
env: updated env file...
super-admin -
r9:fed1dc43
parent child Browse files
Show More
@@ -1,25 +1,28 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.26.0"
5 RC_VERSION="4.26.0"
6
6
7 # Database access credentials
7 # Database access credentials
8 DB_NAME=rhodecode
8 DB_NAME=rhodecode
9 DB_USER=rhodecode
9 DB_USER=rhodecode
10 DB_PASSWORD=hUc1adS7oDd6Oj3in3
10 DB_PASSWORD=hUc1adS7oDd6Oj3in3
11
11
12 # base url for running app
12 # base url for running app
13 RHODECODE_BASE_URL=http://localhost:8888
13 RHODECODE_BASE_URL=http://localhost:8888
14
14
15 # HTTP and HTTPS ports for running app
15 # HTTP and HTTPS ports for running app
16 RC_HTTP_PORT=8888
16 RC_HTTP_PORT=8888
17 RC_HTTPS_PORT=8443
17 RC_HTTPS_PORT=8443
18
18
19 # SSH Port exposed, increased security is to not used default 22
19 # SSH Port exposed, increased security is to not used default 22
20 RC_SSH_PORT=9022
20 RC_SSH_PORT=9022
21
21
22 # user/password for first admin user created for access
22 # user/password for first admin user created for access
23 RHODECODE_USER_EMAIL=admin@rhodecode.com
23 RHODECODE_USER_EMAIL=admin@rhodecode.com
24 RHODECODE_USER_NAME=admin
24 RHODECODE_USER_NAME=admin
25 RHODECODE_USER_PASS=qweqwe
25 RHODECODE_USER_PASS=secret4
26
27 ## New since 4.27.0, default GIT branch name can be changed
28 GIT_DEFAULT_BRANCH_NAME=master No newline at end of file
@@ -1,253 +1,257 b''
1 # RhodeCode Cluster
1 # RhodeCode Cluster
2
2
3 RhodeCode Cluster is a multi-node highly-scalable setup to run RhodeCode and
3 RhodeCode Cluster is a multi-node highly-scalable setup to run RhodeCode and
4 all its additional components in single environment using Docker.
4 all its additional components in single environment using Docker.
5
5
6 Using a docker-compose this setup creates following services for RhodeCode:
6 Using a docker-compose this setup creates following services for RhodeCode:
7
7
8 - Nginx HTTP Server for load balancing and reverse proxy
8 - Nginx HTTP Server for load balancing and reverse proxy
9 - RhodeCode HTTP
9 - RhodeCode HTTP
10 - VCSServer for GIT/SVN/HG support
10 - VCSServer for GIT/SVN/HG support
11 - SSH Server for cloning over SSH
11 - SSH Server for cloning over SSH
12 - SVN webserver for HTTP support over SVN
12 - SVN webserver for HTTP support over SVN
13 - Celery workers for asynchronous tasks
13 - Celery workers for asynchronous tasks
14 - Celery beat for automation tasks
14 - Celery beat for automation tasks
15 - Redis Database for caching
15 - Redis Database for caching
16 - Postgres database for persistent storage
16 - Postgres database for persistent storage
17 - Channelstream websocket server for live components
17 - Channelstream websocket server for live components
18
18
19
19
20 ## Pre requisites
20 ## Pre requisites
21
21
22 Visit docker site and install docker (min version 20.10) and docker compose:
22 Visit docker site and install docker (min version 20.10) and docker compose:
23
23
24 - https://docs.docker.com/engine/install/
24 - https://docs.docker.com/engine/install/
25 - https://docs.docker.com/compose/install/
25 - https://docs.docker.com/compose/install/
26
26
27 The instructions below outline installation of the current stable release (v1.29.2) of Compose.
27
28
28 ## Data structure
29 ## Data structure
29
30
30 There are 4 volumes defined:
31 There are 4 volumes defined:
31
32
32
33
33 - `/etc/rhodecode/conf`
34 - `/etc/rhodecode/conf`
34
35
35 Used for configuration files for rhodecode, vcsserver and supervisord, and some cache data
36 Used for configuration files for rhodecode, vcsserver and supervisord, and some cache data
36
37
37 - `/var/opt/rhodecode_repo_store`
38 - `/var/opt/rhodecode_repo_store`
38
39
39 Used for main repository storage where repositories would be stored
40 Used for main repository storage where repositories would be stored
40
41
41 - `/var/opt/rhodecode_data`
42 - `/var/opt/rhodecode_data`
42
43
43 data dir for rhodecode cache/lock files, or user sessions (for file backend)
44 data dir for rhodecode cache/lock files, or user sessions (for file backend)
44
45
45 - `/var/log/rhodecode`
46 - `/var/log/rhodecode`
46
47
47 Used to store all logs from RhodeCode
48 Used to store all logs from RhodeCode
48
49
49
50
50 ## Setup/Build options
51 ## Setup/Build options
51
52
52 There are 3 options to run the docker stack.
53 There are 3 options to run the docker stack.
53
54
54 - [Standalone cluster build from installer](#standalone-cluster-build-from-installer)
55 - [Standalone cluster build from installer](#standalone-cluster-build-from-installer)
55 - [Standalone cluster build from source](#standalone-cluster-build-from-source)
56 - [Standalone cluster build from source](#standalone-cluster-build-from-source)
56 - [dev enviroment setup](#like-this-one)
57 - [dev enviroment setup](#like-this-one)
57
58
58
59
59 # Standalone cluster build from installer
60 # Standalone cluster build from installer
60
61
61 Follow these steps to build and run the RhodeCode Cluster via Docker-compose.
62 Follow these steps to build and run the RhodeCode Cluster via Docker-compose.
62 Get the repository:
63 Get the repository:
63
64
64 git clone https://code.rhodecode.com/rhodecode-enterprise-docker && cd rhodecode-enterprise-docker
65 git clone https://code.rhodecode.com/rhodecode-enterprise-docker && cd rhodecode-enterprise-docker
65
66
66 ## Download installer binaries
67 ## Download installer binaries
67
68
68 First start by fetching required installer binaries. This is required to create both
69 First start by fetching required installer binaries. This is required to create both
69 simple build and full compose setup.
70 simple build and full compose setup.
70 Please check the `.env` file to adjust the version if needed.
71 Please check the `.env` file to adjust the version if needed.
71
72
72 ```shell
73 ```shell
73 cd .bootstrap/ && ./download-artifacts.sh && cd ../
74 cd .bootstrap/ && ./download-artifacts.sh && cd ../
74 ```
75 ```
75
76
76 This will download required files and put them into the `.cache` directory.
77 This will download required files and put them into the `.cache` directory.
77 This directory should look similar to that after downloads have finish:
78 This directory should look similar to that after downloads have finish:
78
79
79 ```shell
80 ```shell
80 drwxr-xr-x 8 rcdev rcdev 256B Feb 8 13:35 .
81 drwxr-xr-x 8 rcdev rcdev 256B Feb 8 13:35 .
81 drwxr-xr-x 14 rcdev rcdev 448B Feb 8 10:40 ..
82 drwxr-xr-x 14 rcdev rcdev 448B Feb 8 10:40 ..
82 -rw-r--r-- 1 rcdev rcdev 0B Feb 8 20:44 .dirkeep
83 -rw-r--r-- 1 rcdev rcdev 0B Feb 8 20:44 .dirkeep
83 -rwxr-xr-x 1 rcdev rcdev 241M Feb 8 13:35 RhodeCode-installer-linux-build20210208_0800
84 -rwxr-xr-x 1 rcdev rcdev 241M Feb 8 13:35 RhodeCode-installer-linux-build20210208_0800
84 -rw-r--r-- 1 rcdev rcdev 156M Feb 8 13:35 RhodeCodeCommunity-4.24.1+x86_64-linux_build20210208_0800.tar.bz2
85 -rw-r--r-- 1 rcdev rcdev 156M Feb 8 13:35 RhodeCodeCommunity-4.24.1+x86_64-linux_build20210208_0800.tar.bz2
85 -rw-r--r-- 1 rcdev rcdev 171M Feb 8 13:35 RhodeCodeEnterprise-4.24.1+x86_64-linux_build20210208_0800.tar.bz2
86 -rw-r--r-- 1 rcdev rcdev 171M Feb 8 13:35 RhodeCodeEnterprise-4.24.1+x86_64-linux_build20210208_0800.tar.bz2
86 -rw-r--r-- 1 rcdev rcdev 145M Feb 8 13:35 RhodeCodeVCSServer-4.24.1+x86_64-linux_build20210208_0800.tar.bz2
87 -rw-r--r-- 1 rcdev rcdev 145M Feb 8 13:35 RhodeCodeVCSServer-4.24.1+x86_64-linux_build20210208_0800.tar.bz2
87 -rw-r--r-- 1 rcdev rcdev 109M Feb 8 13:35 locale-archive
88 -rw-r--r-- 1 rcdev rcdev 109M Feb 8 13:35 locale-archive
88 ```
89 ```
89
90
90 ## Set License for EE version
91 ## Set License for EE version
91
92
92 This setup would use a provided license from a file
93 In order to setup EE edition with a valid license applied during build phase
93 `config/compose/rhodecode_enterprise.license` If you have a full license, or a trial one
94 Save your raw license data into a file
94 please save the license data inside this file, so it will be applied at creation.
95
95 This file can also be empty and license can be applied via a WEB interface.
96 `config/compose/rhodecode_enterprise.license`
97
98 If this file is present build phase will read it and license will be applied at creation.
99 This file can also be empty and license can be applied via a WEB interface after first login.
96
100
97 ## Run Docker compose build:
101 ## Run Docker compose build:
98
102
99 *This will build RhodeCode based on downloaded installer packages.*
103 *This will build RhodeCode based on downloaded installer packages.*
100
104
101 To create a full stack we need to run the database container, so it's ready to
105 To create a full stack we need to run the database container, so it's ready to
102 build the docker image.
106 build the docker image.
103
107
104 1) start with running the required database for the build stage in the background.
108 1) start with running the required database for the build stage in the background.
105
109
106 ```shell
110 ```shell
107 docker-compose up --detach database
111 docker-compose up --detach database
108 ```
112 ```
109
113
110 This will start our postgres database, and expose it to the network.
114 This will start our postgres database, and expose it to the network.
111
115
112 2) We can now run the full installation. Database needs to be running for the next build command.
116 2) We can now run the full installation. Database needs to be running for the next build command.
113
117
114 ```shell
118 ```shell
115 docker-compose build rhodecode
119 docker-compose build rhodecode
116 docker-compose build
120 docker-compose build
117 ```
121 ```
118
122
119 _Disk space problems?_
123 _Disk space problems?_
120
124
121 ```shell
125 ```shell
122 docker system df
126 docker system df
123 docker builder prune
127 docker builder prune
124 ```
128 ```
125
129
126 3) Once we build the rhodecode app, we can run the whole stack using `docker-compose up`
130 3) Once we build the rhodecode app, we can run the whole stack using `docker-compose up`
127
131
128 ```shell
132 ```shell
129 docker-compose up
133 docker-compose up
130 ```
134 ```
131
135
132 If running locally you can access Running RhodeCode via Nginx under:
136 If running locally you can access Running RhodeCode via Nginx under:
133 http://localhost:8888
137 http://localhost:8888
134
138
135 localhost can be changed to the server IP where docker is running.
139 localhost can be changed to the server IP where docker is running.
136
140
137
141
138 In case for bigger setups docker-compose can scale more rhodecode/vcsserver workers:
142 In case for bigger setups docker-compose can scale more rhodecode/vcsserver workers:
139
143
140 ```shell
144 ```shell
141 docker-compose up --scale vcsserver=3 rhodecode=3
145 docker-compose up --scale vcsserver=3 rhodecode=3
142 ```
146 ```
143
147
144
148
145 Upgrade:
149 Upgrade:
146
150
147 - pull the latest rhodecode-docker repo
151 - pull the latest rhodecode-docker repo
148 - check .env file for correct update version
152 - check .env file for correct update version
149 - re-build rhodecode
153 - re-build rhodecode
150 - docker-compose build rhodecode
154 - docker-compose build rhodecode
151 - docker-compose stop
155 - docker-compose stop
152 - docker-compose up
156 - docker-compose up
153
157
154 # Standalone cluster build from source
158 # Standalone cluster build from source
155
159
156 There's an option to build the latest branches as a docker installation.
160 There's an option to build the latest branches as a docker installation.
157
161
158 Download the source:
162 Download the source:
159
163
160 ```shell
164 ```shell
161 cd .boostrap/ && ./download-source.sh && cd ../
165 cd .boostrap/ && ./download-source.sh && cd ../
162 ```
166 ```
163
167
164 This step will create source code copies into the `.source/` path. e.g
168 This step will create source code copies into the `.source/` path. e.g
165 ```
169 ```
166 -rw-r--r-- 1 docker docker 0 Nov 25 12:27 .dirkeep
170 -rw-r--r-- 1 docker docker 0 Nov 25 12:27 .dirkeep
167 drwxr-xr-x 1 docker docker 1184 Nov 25 12:27 rhodecode-enterprise-ce
171 drwxr-xr-x 1 docker docker 1184 Nov 25 12:27 rhodecode-enterprise-ce
168 drwxr-xr-x 1 docker docker 1120 Nov 25 12:27 rhodecode-enterprise-ee
172 drwxr-xr-x 1 docker docker 1120 Nov 25 12:27 rhodecode-enterprise-ee
169 drwxr-xr-x 1 docker docker 800 Nov 25 12:27 rhodecode-vcsserver
173 drwxr-xr-x 1 docker docker 800 Nov 25 12:27 rhodecode-vcsserver
170 ```
174 ```
171
175
172 If you have the source already, this step can be omitted, and the
176 If you have the source already, this step can be omitted, and the
173 sources can be linked or copied to this directory
177 sources can be linked or copied to this directory
174
178
175
179
176 Build the source based image
180 Build the source based image
177
181
178 ```shell
182 ```shell
179 docker-compose -f docker-compose.yaml -f docker-compose.source.yaml build --no-cache --progress=plain rhodecode
183 docker-compose -f docker-compose.yaml -f docker-compose.source.yaml build --no-cache --progress=plain rhodecode
180 ```
184 ```
181
185
182 to create a source install override and build based on the downloaded sources.
186 to create a source install override and build based on the downloaded sources.
183
187
184
188
185 Logging is pushed to stdout from all services.
189 Logging is pushed to stdout from all services.
186
190
187 ## Simple build
191 ## Simple build
188
192
189 Build docker RhodeCode `Community` without any dependencies (redis, external db) using
193 Build docker RhodeCode `Community` without any dependencies (redis, external db) using
190 simple sqlite database and file based caches.
194 simple sqlite database and file based caches.
191 This is a fully running instance good for small use with 3-5 users.
195 This is a fully running instance good for small use with 3-5 users.
192
196
193 ```shell
197 ```shell
194 docker build -t rhodecode:4.23.2 -f rhodecode.dockerfile \
198 docker build -t rhodecode:4.23.2 -f rhodecode.dockerfile \
195 -e RHODECODE_TYPE=Community \
199 -e RHODECODE_TYPE=Community \
196 -e RHODECODE_VERSION=4.23.2 \
200 -e RHODECODE_VERSION=4.23.2 \
197 -e RHODECODE_DB=sqlite \
201 -e RHODECODE_DB=sqlite \
198 -e RHODECODE_USER_NAME=admin \
202 -e RHODECODE_USER_NAME=admin \
199 -e RHODECODE_USER_PASS=secret4 \
203 -e RHODECODE_USER_PASS=secret4 \
200 -e RHODECODE_USER_EMAIL=support@rhodecode.com \
204 -e RHODECODE_USER_EMAIL=support@rhodecode.com \
201 .
205 .
202 ```
206 ```
203
207
204 note: for debugging better to add `--progress plain` into the build command to obtain all the output from the build.
208 note: for debugging better to add `--progress plain` into the build command to obtain all the output from the build.
205 To Build against existing running Postgres or MySQL you can specify:
209 To Build against existing running Postgres or MySQL you can specify:
206
210
207 --build-arg RHODECODE_DB=postgresql://postgres:secret@database/rhodecode
211 --build-arg RHODECODE_DB=postgresql://postgres:secret@database/rhodecode
208 --build-arg RHODECODE_DB=mysql://root:secret@localhost/rhodecode?charset=utf8
212 --build-arg RHODECODE_DB=mysql://root:secret@localhost/rhodecode?charset=utf8
209
213
210
214
211 To copy over the data into volumes use such command:
215 To copy over the data into volumes use such command:
212 ```shell
216 ```shell
213 docker run -v logvolume:/data --name data_vol busybox true
217 docker run -v logvolume:/data --name data_vol busybox true
214 docker cp . data_vol:/data
218 docker cp . data_vol:/data
215 docker rm data_vol
219 docker rm data_vol
216 ```
220 ```
217
221
218 Run the container, mounting the required volumes. By default the application would be
222 Run the container, mounting the required volumes. By default the application would be
219 available at http://localhost:10020, and default login is (unless specified differently in the build command)
223 available at http://localhost:10020, and default login is (unless specified differently in the build command)
220
224
221 ```
225 ```
222 user: admin
226 user: admin
223 password: secret4
227 password: secret4
224 ```
228 ```
225
229
226 We've not built our image using specific version. It's time to run it:
230 We've not built our image using specific version. It's time to run it:
227
231
228 ```shell
232 ```shell
229 docker run \
233 docker run \
230 --name rhodecode-container \
234 --name rhodecode-container \
231 --publish 10020:10020 \
235 --publish 10020:10020 \
232 --restart unless-stopped \
236 --restart unless-stopped \
233 --volume $PWD/config:/etc/rhodecode/conf \
237 --volume $PWD/config:/etc/rhodecode/conf \
234 --volume $PWD/logs:/var/log/rhodecode \
238 --volume $PWD/logs:/var/log/rhodecode \
235 'rhodecode:4.23.2'
239 'rhodecode:4.23.2'
236 ```
240 ```
237
241
238 Enter container
242 Enter container
239
243
240 ```shell
244 ```shell
241 docker exec -it rhodecode-container /bin/bash
245 docker exec -it rhodecode-container /bin/bash
242 ```
246 ```
243
247
244 Enter interactive shell
248 Enter interactive shell
245
249
246 ```shell
250 ```shell
247 docker exec -it rhodecode-container /var/opt/rhodecode_bin/bin/rc-ishell /etc/rhodecode/conf/rhodecode.ini
251 docker exec -it rhodecode-container /var/opt/rhodecode_bin/bin/rc-ishell /etc/rhodecode/conf/rhodecode.ini
248 ```
252 ```
249
253
250 Run Database migrations
254 Run Database migrations
251 ```shell
255 ```shell
252 docker exec -it rhodecode-container /var/opt/rhodecode_bin/bin/rc-upgrade-db /etc/rhodecode/conf/rhodecode.ini --force-yes
256 docker exec -it rhodecode-container /var/opt/rhodecode_bin/bin/rc-upgrade-db /etc/rhodecode/conf/rhodecode.ini --force-yes
253 ``` No newline at end of file
257 ```
General Comments 0
You need to be logged in to leave comments. Login now