Skip to content

Commit 058456d

Browse files
committed
Add more options to start up
1 parent 1dd703a commit 058456d

File tree

3 files changed

+168
-3
lines changed

3 files changed

+168
-3
lines changed

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,30 @@ so you can be your own local "DevOp"; nearly every category of [periodic table o
4545

4646
If your change the ports in the docker-compose.yml change them also in nginx-reverse/nginx.conf (stream {...} )
4747
## Installation
48-
### without sonar
48+
4949
Bring up your own DevOp Playground ... just do a
50+
51+
### minimal setup (GitLab,GitLab-runner,Jenkins,Nexus,Postgres) takes 6GiB
52+
```
53+
git clone https://github.com/Springjunky/docker-local-build-environment.git
54+
cd docker-local-build-environment
55+
sudo ./setupEnvironment.sh
56+
docker-compose up -f docker-compose-minimal-ci.yml up --build
57+
docker-compose logs
58+
```
59+
starts 6 container
60+
61+
### medium setup without sonar (same like above and with Docker-Registry and simple Docker-Registry-UI) takes 8GiB
5062
```
5163
git clone https://github.com/Springjunky/docker-local-build-environment.git
5264
cd docker-local-build-environment
5365
sudo ./setupEnvironment.sh
5466
docker-compose up --build -d
5567
docker-compose logs
5668
```
69+
starts 8 container
5770

58-
### with sonar and/or Keycloak
59-
Warning: you need a lot of memory to use the full toolset (more than 10GB)
71+
### maximum setup (same like above and with Sonar and Keycloak) takes more than 10GiB
6072
```
6173
git clone https://github.com/Springjunky/docker-local-build-environment.git
6274
cd docker-local-build-environment
@@ -73,6 +85,8 @@ Warning: you need a lot of memory to use the full toolset (more than 10GB)
7385
7486
docker-compose logs
7587
```
88+
start 10 container
89+
7690
### The first startup takes a long time (especially gitlab), so be patient
7791
open your favorite browser (_not_ at localhost, use the $(hostname)/jenkins )
7892
to prevent jenkins spit out "your reverse proxy is wrong")

docker-compose-minimal-ci.yml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
#####################################
2+
# Don't touch this file is generated
3+
# expecilly for: ${DC_HOSTNAME}
4+
###################################
5+
#
6+
# Consider to Backup ${DC_BASE_DATA_DIR}
7+
#
8+
version: "3"
9+
10+
networks:
11+
devstacknetwork:
12+
driver: bridge
13+
14+
services:
15+
# ------------------------------------------------------------------------------
16+
ngnix:
17+
container_name: nginx-reverse
18+
build: nginx-reverse
19+
ports:
20+
- 80:80 # http://
21+
- 5432:5432 # Default-Port of the Postges DB passing jdbc-Connections to the postgres-Container
22+
- 2222:2222 # ssh port of gitlab (ssh://git@myHOST:2222/scott/foo.git)
23+
- 5555:5555 # Gitlab Docker Registry do NOT use 5000, this is an internal PORT of the gitlab-ce Image
24+
#command: ["nginx-debug", "-g", "daemon off;"] # Start nginx in debug to see whats going on
25+
depends_on: # start proxy after all the others
26+
- gitlab
27+
- jenkins
28+
- nexus
29+
volumes:
30+
# Overwrites the Dockerfile Copys (ugly but works)
31+
- ./nginx-reverse/reverse-proxy-min.conf:/etc/nginx/conf.d/reverse-proxy.conf
32+
networks:
33+
- devstacknetwork
34+
35+
36+
# ------------------------------------------------------------------------------
37+
jenkins:
38+
build: jenkins-fat
39+
container_name: jenkins-fat
40+
extra_hosts:
41+
- ${DC_HOSTNAME}:${DC_HOSTIP}
42+
networks:
43+
- devstacknetwork
44+
volumes:
45+
- ${DC_BASE_DATA_DIR}/jenkins:/var/jenkins_home
46+
- /var/run/docker.sock:/var/run/docker.sock
47+
# ------------------------------------------------------------------------------
48+
gitlab:
49+
image: 'gitlab/gitlab-ce:latest'
50+
container_name: gitlab-ce
51+
extra_hosts:
52+
- ${DC_HOSTNAME}:${DC_HOSTIP}
53+
networks:
54+
- devstacknetwork
55+
environment:
56+
GITLAB_OMNIBUS_CONFIG: |
57+
external_url 'http://${DC_HOSTNAME}/gitlab'
58+
gitlab_rails['initial_root_password'] = "gitlab4me"
59+
gitlab_rails['initial_shared_runners_registration_token'] = "s3cretToken4Runner"
60+
gitlab_rails['gitlab_shell_ssh_port'] = 2222
61+
# docker-registry config
62+
registry_external_url 'https://${DC_HOSTNAME}:5555'
63+
registry_nginx['listen_port'] = 5555
64+
registry_nginx['listen_https'] = true
65+
# SSL config just for the docker-registry need
66+
nginx['ssl_certificate'] = "/etc/gitlab/ssl/${DC_HOSTNAME}.crt"
67+
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/${DC_HOSTNAME}.key"
68+
registry_nginx['proxy_set_headers'] = {
69+
"X-Forwarded-Proto" => "https",
70+
"X-Forwarded-Ssl" => "on"
71+
}
72+
volumes:
73+
- ${DC_BASE_DATA_DIR}/gitlab/config:/etc/gitlab
74+
- ${DC_BASE_DATA_DIR}/gitlab/logs:/var/log/gitlab
75+
- ${DC_BASE_DATA_DIR}/gitlab/data:/var/opt/gitlab
76+
# ------------------------------------------------------------------------------
77+
nexus:
78+
image: sonatype/nexus3
79+
container_name: sonatype-nexus3
80+
extra_hosts:
81+
- ${DC_HOSTNAME}:${DC_HOSTIP}
82+
networks:
83+
- devstacknetwork
84+
environment:
85+
- NEXUS_CONTEXT=nexus
86+
volumes:
87+
- ${DC_BASE_DATA_DIR}/nexus:/nexus-data
88+
# ------------------------------------------------------------------------------
89+
gitlabrunner:
90+
build: gitlabrunner
91+
container_name: gitlabrunner
92+
network_mode: "host"
93+
extra_hosts:
94+
- ${DC_HOSTNAME}:${DC_HOSTIP}
95+
environment:
96+
- GITLAB_URL=http://${DC_HOSTNAME}/gitlab
97+
- HOSTNAME=${DC_HOSTNAME}
98+
- HOSTIP=${DC_HOSTIP}
99+
- REGISTER_TOKEN=s3cretToken4Runner
100+
- REGISTER_TRYS=60 # every 10 seconds a try to register the runner..gitlab takes a long time to startup
101+
volumes:
102+
- ${DC_BASE_DATA_DIR}/gitlab-runner/config:/etc/gitlab-runner
103+
- /var/run/docker.sock:/var/run/docker.sock
104+
105+
# ------------------------------------------------------------------------------
106+
postgres:
107+
container_name: postgres
108+
build: postgres
109+
extra_hosts:
110+
- ${DC_HOSTNAME}:${DC_HOSTIP}
111+
environment:
112+
- POSTGRES_PASSWORD=admin
113+
- POSTGRES_USER=postgres
114+
networks:
115+
- devstacknetwork
116+
volumes:
117+
- ${DC_BASE_DATA_DIR}/postgres-db/postgresql:/var/lib/postgresql
118+
# This needs explicit mapping due to
119+
# https://github.com/docker-library/postgres/blob/4e48e3228a30763913ece952c611e5e9b95c8759/Dockerfile.template#L52
120+
# there is ENV PGDATA /var/lib/postgresql/data
121+
- ${DC_BASE_DATA_DIR}/postgres-db/postgresql_data:/var/lib/postgresql/data
122+
123+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
3+
4+
# Setting all the prefixes is a crazy ..
5+
6+
server {
7+
listen 80;
8+
server_name "" ;
9+
access_log on;
10+
11+
# Same like external_url 'http://HOSTNAME/gitlab' in docker-compose
12+
location ^~/gitlab {
13+
proxy_pass http://gitlab:80;
14+
include /etc/nginx/conf.d/proxy-settings.conf;
15+
}
16+
17+
# Same like ENV JENKINS_OPTS=.....--prefix=/jenkins in jenkins-fat/Jenkins-Dockerfile
18+
location ^~/jenkins {
19+
proxy_pass http://jenkins:8080;
20+
include /etc/nginx/conf.d/proxy-settings.conf;
21+
}
22+
23+
# Same like NEXUS_CONTEXT=nexus in docker-compose
24+
location ^~/nexus {
25+
proxy_pass http://nexus:8081;
26+
include /etc/nginx/conf.d/proxy-settings.conf;
27+
}
28+
}

0 commit comments

Comments
 (0)