-
Notifications
You must be signed in to change notification settings - Fork 35
/
docker-compose.yml
161 lines (153 loc) · 5.51 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#####################################
# Don't touch this file is generated
# expecilly for: ${DC_HOSTNAME}
###################################
#
# Consider to Backup ${DC_BASE_DATA_DIR}
#
version: "3"
####test
networks:
devstacknetwork:
driver: bridge
services:
# ------------------------------------------------------------------------------
ngnix:
container_name: nginx-reverse
build: nginx-reverse
ports:
- 80:80 # http://
- 5432:5432 # Default-Port of the Postges DB passing jdbc-Connections to the postgres-Container
- 2222:2222 # ssh port of gitlab (ssh://git@myHOST:2222/scott/foo.git)
- 5555:5555 # Gitlab Docker Registry do NOT use 5000, this is an internal PORT of the gitlab-ce Image
#command: ["nginx-debug", "-g", "daemon off;"] # Start nginx in debug to see whats going on
depends_on: # start proxy after all the others
- gitlab
- jenkins
- nexus
- portainer
networks:
- devstacknetwork
# ------------------------------------------------------------------------------
regweb:
container_name: docker-registry-web
image: hyper/docker-registry-web:v0.1.2
networks:
- devstacknetwork
extra_hosts:
- ${DC_HOSTNAME}:${DC_HOSTIP}
environment:
- REGISTRY_URL=http://${DC_HOSTNAME}:5000/v2
- REGISTRY_NAME=Your docker-local-build-registry@${DC_HOSTNAME}:5000
- REGISTRY_READONLY=false
- REGISTRY_CONTEXT_PATH=/regweb
# ------------------------------------------------------------------------------
portainer:
image: portainer/portainer:linux-amd64-1.21.0
container_name: portainer
command: --no-auth
networks:
- devstacknetwork
extra_hosts:
- ${DC_HOSTNAME}:${DC_HOSTIP}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# ------------------------------------------------------------------------------
registry:
container_name: registry
image: registry:2.7.1
network_mode: "host"
ports:
- 5000:5000
volumes:
- ${DC_BASE_DATA_DIR}/docker-registry/config.yml:/etc/docker/registry/config.yml
- ${DC_BASE_DATA_DIR}/docker-registry/images:/var/lib/registry
# ------------------------------------------------------------------------------
postgres:
container_name: postgres
build: postgres
extra_hosts:
- ${DC_HOSTNAME}:${DC_HOSTIP}
environment:
- POSTGRES_PASSWORD=admin
- POSTGRES_USER=postgres
networks:
- devstacknetwork
volumes:
- ${DC_BASE_DATA_DIR}/postgres-db/postgresql:/var/lib/postgresql
# This needs explicit mapping due to
# https://github.com/docker-library/postgres/blob/4e48e3228a30763913ece952c611e5e9b95c8759/Dockerfile.template#L52
# there is ENV PGDATA /var/lib/postgresql/data
- ${DC_BASE_DATA_DIR}/postgres-db/postgresql_data:/var/lib/postgresql/data
# ------------------------------------------------------------------------------
jenkins:
build:
context: jenkins-fat
args:
JENKINS_LTS_VERSION: ${JENKINS_LTS}
container_name: jenkins-fat
extra_hosts:
- ${DC_HOSTNAME}:${DC_HOSTIP}
networks:
- devstacknetwork
volumes:
- ${DC_BASE_DATA_DIR}/jenkins:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
# ------------------------------------------------------------------------------
gitlab:
image: 'gitlab/gitlab-ce:12.0.2-ce.0'
container_name: gitlab-ce
extra_hosts:
- ${DC_HOSTNAME}:${DC_HOSTIP}
networks:
- devstacknetwork
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://${DC_HOSTNAME}/gitlab'
gitlab_rails['initial_root_password'] = "gitlab4me"
gitlab_rails['initial_shared_runners_registration_token'] = "s3cretToken4Runner"
gitlab_rails['gitlab_shell_ssh_port'] = 2222
# docker-registry config
registry_external_url 'https://${DC_HOSTNAME}:5555'
registry_nginx['listen_port'] = 5555
registry_nginx['listen_https'] = true
# SSL config just for the docker-registry need
nginx['ssl_certificate'] = "/etc/gitlab/ssl/${DC_HOSTNAME}.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/${DC_HOSTNAME}.key"
registry_nginx['proxy_set_headers'] = {
"X-Forwarded-Proto" => "https",
"X-Forwarded-Ssl" => "on"
}
volumes:
- ${DC_BASE_DATA_DIR}/gitlab/config:/etc/gitlab
- ${DC_BASE_DATA_DIR}/gitlab/logs:/var/log/gitlab
- ${DC_BASE_DATA_DIR}/gitlab/data:/var/opt/gitlab
## ------------------------------------------------------------------------------
nexus:
image: sonatype/nexus3:3.17.0
container_name: sonatype-nexus3
extra_hosts:
- ${DC_HOSTNAME}:${DC_HOSTIP}
networks:
- devstacknetwork
environment:
- NEXUS_CONTEXT=nexus
volumes:
- ${DC_BASE_DATA_DIR}/nexus:/nexus-data
# ------------------------------------------------------------------------------
gitlabrunner:
build: gitlabrunner
container_name: gitlabrunner
network_mode: "host"
privileged: true
extra_hosts:
- ${DC_HOSTNAME}:${DC_HOSTIP}
environment:
- GITLAB_URL=http://${DC_HOSTNAME}/gitlab
- HOSTNAME=${DC_HOSTNAME}
- HOSTIP=${DC_HOSTIP}
- REGISTER_TOKEN=s3cretToken4Runner
- REGISTER_TRYS=60 # every 10 seconds a try to register the runner..gitlab takes a long time to startup
volumes:
- ${DC_BASE_DATA_DIR}/gitlab-runner/config:/etc/gitlab-runner
- /var/run/docker.sock:/var/run/docker.sock