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