-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
121 lines (108 loc) · 3.31 KB
/
Copy pathdocker-compose.yml
File metadata and controls
121 lines (108 loc) · 3.31 KB
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
version: "2.1"
services:
redmine:
build:
context: ./services/redmine/
image: kannji_grace_redmine
restart: always
environment:
- REDMINE_DB_MYSQL=redmine-db
- REDMINE_DB_PASSWORD
depends_on:
redmine-db:
condition: service_healthy
networks:
redmine:
aliases:
- redmine
nginx:
redmine-db:
image: mysql
restart: always
environment:
- MYSQL_DATABASE=redmine
- MYSQL_ROOT_PASSWORD=${REDMINE_DB_PASSWORD}
volumes:
- ./services/redmine/mounts/db:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10
networks:
redmine:
aliases:
- redmine-db
owncloud:
build:
context: ./services/owncloud/
image: kannji_grace_owncloud
volumes:
- ./services/owncloud/mounts/apps:/var/www/html/apps
- ./services/owncloud/mounts/config:/var/www/html/config
- ./services/owncloud/mounts/data:/var/www/html/data
depends_on:
owncloud-db:
condition: service_healthy
networks:
owncloud:
aliases:
- owncloud
nginx:
owncloud-db:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=${OWNCLOUD_DB_PASSWORD}
volumes:
- ./services/owncloud/mounts/db:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10
networks:
owncloud:
aliases:
- owncloud-db
jenkins:
image: jenkins
restart: always
volumes:
# when mount not working, do this on host: sudo chown -R 1000 services/jenkins/mounts/jenkins_home
- ./services/jenkins/mounts/jenkins_home:/var/jenkins_home
environment:
# for making jenkins run in a sub url, like so: http://host.tld/jenkins
- JENKINS_OPTS=--prefix=/jenkins
networks:
- nginx
# the nginx server
nginx:
# build it by using the DOcker file at context
build:
context: ./services/nginx/
# give it this name
image: kannji_grace_nginx
#restart: always
# the nginx needs to handle requests from outside the host, so we add these port-mappings.
# on the host all incoming requests to the port 80 will be forwarded to the containers 80 port.
# same with the 443 port (https)
# sceme: <port on container:port on host>
# example: "8000:80" will map all requests to the host on port 8000 to the container on port 80
ports:
- "80:80"
- "443:443"
# to be able pass requests to other containers the nginx has an own network.
# all accessible containers must be in this network.
networks:
- nginx
# as nginx checks if hostnames in the config file are accessible, the nginx can only start, when the api-server is running.
# technically we would need a health-check, but the api-server starts so fast, that it's not necessary
depends_on:
- redmine
- owncloud
- jenkins
# here we specify which networks should be created
# only networks that are written down here can be referenced in the services. (exception being the 'default' network, which we don't use due to it's meaningless name)
networks:
# we don't want any fancy config for our networks, so only the name suffices
owncloud:
redmine:
nginx: