-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
100 lines (96 loc) · 3.08 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
version: '2'
services:
db-gerrit:
container_name: ci-infra-db
image: mysql:latest
networks:
- ci-infra-net
volumes:
- ${VOLUME_PATH}/mysql_volume:/var/lib/mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: 1qaz
MYSQL_DATABASE: reviewdb
MYSQL_USER: gerrit
MYSQL_PASSWORD: gerrit_pass
command: mysqld --sql_mode="ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
gerrit:
container_name: ci-infra-gerrit
image: openfrontier/gerrit
networks:
- ci-infra-net
links:
- db-gerrit:mysql
ports:
- "29418:29418"
volumes:
- ${VOLUME_PATH}/gerrit_volume:/var/gerrit/review_site
restart: unless-stopped
environment:
WEBURL: http://${WEB_SERVER_NAME}/gerrit
HTTPD_LISTENURL: proxy-http://*:8080/gerrit
DATABASE_TYPE: mysql
DB_PORT_3306_TCP_ADDR: db-gerrit
DB_PORT_3306_TCP_PORT: 3306
DB_ENV_MYSQL_DB: reviewdb
DB_ENV_MYSQL_USER: gerrit
DB_ENV_MYSQL_PASSWORD: gerrit_pass
SMTP_SERVER: ${SMTP_SERVER}
SMTP_SERVER_PORT: ${SMTP_SERVER_PORT}
SMTP_ENCRYPTION: ${SMTP_ENCRYPTION}
SMTP_USER: ${SMTP_USER}
SMTP_PASS: ${SMTP_PASS}
SMTP_CONNECT_TIMEOUT: ${SMTP_CONNECT_TIMEOUT}
SMTP_FROM: ${SMTP_FROM}
AUTH_TYPE: ${AUTH_TYPE}
OAUTH_ALLOW_EDIT_FULL_NAME: ${OAUTH_ALLOW_EDIT_FULL_NAME}
OAUTH_ALLOW_REGISTER_NEW_EMAIL: ${OAUTH_ALLOW_REGISTER_NEW_EMAIL}
OAUTH_GOOGLE_RESTRICT_DOMAIN: ${OAUTH_GOOGLE_RESTRICT_DOMAIN}
OAUTH_GOOGLE_CLIENT_ID: ${OAUTH_GOOGLE_CLIENT_ID}
OAUTH_GOOGLE_CLIENT_SECRET: ${OAUTH_GOOGLE_CLIENT_SECRET}
OAUTH_GOOGLE_LINK_OPENID: ${OAUTH_GOOGLE_LINK_OPENID}
OAUTH_GITHUB_CLIENT_ID: ${OAUTH_GITHUB_CLIENT_ID}
OAUTH_GITHUB_CLIENT_SECRET: ${OAUTH_GITHUB_CLIENT_SECRET}
GERRIT_INIT_ARGS: --install-plugin=download-commands
--install-plugin=singleusergroup
--install-plugin=commit-message-length-validator
depends_on:
- db-gerrit
jenkins:
container_name: ci-infra-jenkins
image: tivalii/jenkins
networks:
- ci-infra-net
volumes:
- ${VOLUME_PATH}/jenkins_volume:/var/jenkins_home
restart: unless-stopped
environment:
JENKINS_OPTS: --prefix=/jenkins
proxy:
container_name: ci-infra-proxy
image: nginx:1.12.2
networks:
- ci-infra-net
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf.tpl:/etc/nginx/nginx.conf.tpl:ro
- ${VOLUME_PATH}/nginx/html:/usr/share/nginx/html:ro
- ${VOLUME_PATH}/nginx/ssl:/etc/nginx/ssl:ro
environment:
SRV_NAME: ${WEB_SERVER_NAME}
command: /bin/bash -c "envsubst '$$SRV_NAME' < /etc/nginx/nginx.conf.tpl > /etc/nginx/nginx.conf && cat /etc/nginx/nginx.conf && nginx -g 'daemon off;'"
depends_on:
- gerrit
- jenkins
networks:
ci-infra-net:
driver: bridge
driver_opts:
"com.docker.network.bridge.name": "ci-infra-net"
ipam:
driver: default
config:
- subnet: 172.18.0.0/24
gateway: 172.18.0.1