-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
150 lines (140 loc) · 3.43 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
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
version: "3.7"
services:
# hk, httpd, php, redis, sshd all use the same image that is build in service hk target
hk:
image: alpine:${ALPINE_VERSION}-extended
hostname: hk
container_name: ${VHOST}_hk
domainname: buildhub.local
build:
context: ./service
dockerfile: hk/Dockerfile
args:
ALPINE_VERSION: ${ALPINE_VERSION}
PHP_VERSION: ${PHP_VERSION}
volumes:
- ./service/hk/bin:/usr/local/sbin:ro
- ./service/hk/conf:/usr/local/conf:ro
- ${CALL_BACK_DIR}:/run/host-callback
- ${WWW_IPB_ROOT}:/var/www/ipb
- var_log:/var/log
- backups:/backups
restart: on-failure
environment:
VHOST: ${VHOST}
httpd:
image: alpine:${ALPINE_VERSION}-extended
hostname: httpd
container_name: ${VHOST}_httpd
depends_on:
- hk
- php
- mysql
restart: on-failure
volumes:
- ./service/httpd/bin:/usr/local/sbin:ro
- ./service/httpd/conf:/usr/local/conf:ro
- ${SSH_CERT_DIR}:/etc/letsencrypt
- ${WWW_IPB_ROOT}:/var/www/ipb
- var_log:/var/log
ports:
- "${HTTP_PORT}:80"
- "${HTTPS_PORT}:443"
environment:
VHOST: ${VHOST}
DOMAIN: ${DOMAIN}
HTTPS_PORT: ${HTTPS_PORT}
APACHE_LOG_DIR: /var/log/apache2
php:
image: alpine:${ALPINE_VERSION}-extended
hostname: php
container_name: ${VHOST}_php
depends_on:
- hk
- mysql
- redis
restart: on-failure
volumes:
- ./service/php/bin:/usr/local/sbin:ro
- ./service/php/conf:/usr/local/conf:ro
- ${WWW_IPB_ROOT}:/var/www/ipb
- var_log:/var/log
environment:
VHOST: ${VHOST}
PHP_VERSION: ${PHP_VERSION}
redis:
image: alpine:${ALPINE_VERSION}-extended
hostname: redis
container_name: ${VHOST}_redis
depends_on:
- hk
restart: on-failure
volumes:
- ./service/redis/bin:/usr/local/sbin:ro
- redis_data:/var/lib/redis
- var_log:/var/log
secrets:
- redis-pwd
mysql:
image: mysql:${MYSQL_VERSION}-extended
hostname: mysql
container_name: ${VHOST}_mysql
build:
context: ./service
dockerfile: mysql/Dockerfile
args:
MYSQL_VERSION: ${MYSQL_VERSION}
restart: on-failure
volumes:
- ./service/mysql/bin:/usr/local/sbin:ro
- ./service/mysql/conf:/usr/local/etc:ro
- mysql_data:/var/lib/mysql
- var_log:/var/log
- backups:/backups
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/mysql-root
MYSQL_DATABASE: ${MYSQL_DATABASE}
TZ: ${TZ}
VHOST: ${VHOST}
secrets:
- mysql-root
security_opt:
- seccomp:unconfined
sshd:
image: alpine:${ALPINE_VERSION}-extended
hostname: sshd
container_name: ${VHOST}_sshd
depends_on:
- hk
restart: on-failure
volumes:
- ./service/sshd/bin:/usr/local/sbin:ro
- /etc/ssh:/usr/local/conf:ro
- var_log:/var/log
- backups:/backups
ports:
- "${SSH_PORT}:22"
environment:
VHOST: ${VHOST}
secrets:
- authorized_keys
secrets:
authorized_keys:
file: .secrets/authorized_keys
mysql-root:
file: .secrets/mysql-root
redis-pwd:
file: .secrets/redis-pwd
volumes:
mysql_data:
external:
name: ${DBHOST}_mysql_data
var_log:
external:
name: ${VHOST}_var_log
backups:
external:
name: ${VHOST}_backups
redis_data:
external:
name: ${VHOST}_redis_data