-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
104 lines (99 loc) · 2.74 KB
/
docker-compose.yaml
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
version: '3.9'
services:
onarqube:
image: sonarqube:lts-community
container_name: sonarqube
restart: always
depends_on:
db:
condition: "service_healthy"
profiles:
- sonarqube
- full
environment:
SONAR_ES_BOOTSTRAP_CHECKS_DISABLE: 'true'
SONAR_TELEMETRY_ENABLE: 'false'
SONAR_JDBC_URL: 'jdbc:postgresql://db:5432/${PG_USERNAME}'
SONAR_JDBC_USERNAME: '${PG_USERNAME}'
SONAR_JDBC_PASSWORD: '${PG_PASSWORD}'
ports:
- '9000:9000'
networks:
- gitlabnet
- sonarnet
volumes:
- ./vols/sonarqube/data:/opt/sonarqube/data
- ./vols/sonarqube/extensions:/opt/sonarqube/extensions
db:
image: postgres
container_name: db
restart: always
healthcheck:
test: [ 'CMD-SHELL', 'pg_isready -U ${PG_USERNAME}']
interval: 5s
timeout: 5s
retries: 5
profiles:
- sonarqube
- full
environment:
POSTGRES_USER: '${PG_USERNAME}'
POSTGRES_PASSWORD: '${PG_PASSWORD}'
networks:
- sonarnet
volumes:
- ./vols/postgresql:/var/lib/postgresql
- ./vols/postgresql_data:/var/lib/postgresql/data
gitlab:
image: gitlab/gitlab-ce:latest
container_name: gitlab
restart: always
healthcheck:
test: [ 'CMD-SHELL', '/opt/gitlab/bin/gitlab-healthcheck --fail --max-time 10']
interval: 30s
timeout: 30s
retries: 5
profiles:
- gitlab
- full
environment:
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://$GITLAB_DOMAIN:8880'
gitlab_rails['gitlab_shell_ssh_port'] = 2222
nginx['listen_port'] = 80
gitlab_rails['initial_root_password'] = '$GITLAB_PASSWORD'
gitlab_rails['initial_shared_runners_registration_token'] = '$GITLAB_RUNNER_TOKEN'
ports:
- "8880:80"
- "2222:22"
networks:
gitlabnet:
aliases:
- $GITLAB_DOMAIN
volumes:
- ./vols/gitlab/config:/etc/gitlab
- ./vols/gitlab/data:/var/opt/gitlab
- ./vols/gitlab/logs:/var/log/gitlab
gitlab-runner:
image: gitlab/gitlab-runner:latest
container_name: gitlab-runner
profiles:
- gitlab
- full
environment:
RUNNER_NAME: 'default-runner'
RUNNER_EXECUTOR: 'docker'
DOCKER_IMAGE: 'ubuntu:latest'
DOCKER_VOLUMES: '/var/run/docker.sock:/var/run/docker.sock'
DOCKER_NETWORK_MODE: '$GITLAB_NETWORK'
networks:
- gitlabnet
volumes:
- ./vols/gitlab-runner/config:/etc/gitlab-runner
- /var/run/docker.sock:/var/run/docker.sock
networks:
sonarnet:
gitlabnet:
external:
name: $GITLAB_NETWORK