-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
143 lines (136 loc) · 3.91 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
services:
# All containers use the same image that is based in a standard Debian slim image
# that has been extended to include the packages needed for all service.
#
# Some directories are routinely accessed by the admins and these are bound to the
# relevant host directory, including ${IPB_ROOT}, /backups and data/log.
#
# All containers bind service/<service>/bin to /usr/local/sbin and this directoy must
# contain the script docker-entrypoint.sh which is used to startup the container.
# Each container can also binds to /usr/local/conf, if needed.
#
# The mysql and redis data directories are each mounted as a persistent docker volume.
# MariaDB service
mysql:
image: debian:${DEBIAN_VERSION}-extended
hostname: mysql
container_name: ${VHOST}_mysql
# this doesn't depend on other services, so it is used to build the debian image.
build:
context: .
dockerfile: Dockerfile
args:
DEBIAN_VERSION: ${DEBIAN_VERSION}
restart: on-failure
volumes:
- ./target-sbin:/usr/local/sbin:ro
- ./service/mysql/bin:/usr/local/bin:ro
- ./service/mysql/conf:/usr/local/conf:ro
- mysql_data:/var/lib/mysql
- ./data/log:/var/log
- ./data/run:/run
- /backups:/backups
environment:
TZ: ${TZ}
VHOST: ${VHOST}
security_opt:
- seccomp:unconfined
# PHP FPM Service
php:
image: debian:${DEBIAN_VERSION}-extended
hostname: php
container_name: ${VHOST}_php
depends_on:
- mysql
restart: on-failure
volumes:
- ./target-sbin:/usr/local/sbin:ro
- ./service/php/bin:/usr/local/bin:ro
- ./service/php/conf:/usr/local/conf:ro
- ${IPB_ROOT}:/var/www/ipb
- ./data/log:/var/log
- ./data/run:/run
secrets:
- forum-token
- redis-pwd
environment:
VHOST: ${VHOST}
PHP_VERSION: ${PHP_VERSION}
# Apache2.4 Service
apache2:
image: debian:${DEBIAN_VERSION}-extended
hostname: apache2
container_name: ${VHOST}_apache2
depends_on:
- php
restart: on-failure
volumes:
- ./target-sbin:/usr/local/sbin:ro
- ./service/apache2/bin:/usr/local/bin:ro
- ./service/apache2/conf:/usr/local/conf:ro
- ${IPB_ROOT}:/var/www/ipb
- ./data/etc/letsencrypt:/etc/letsencrypt
- ./data/log:/var/log
- /backups:/backups
- ./data/run:/run
ports:
- "${HTTP_PORT}:80"
- "${HTTPS_PORT}:443"
environment:
VHOST: ${VHOST}
DOMAIN: ${DOMAIN}
HTTPS_PORT: ${HTTPS_PORT}
APACHE_LOG_DIR: /var/log/apache2
PHP_VERSION: ${PHP_VERSION}
# Python Service used to schedule event-based housekeeping
scheduler:
image: debian:${DEBIAN_VERSION}-extended
hostname: scheduler
container_name: ${VHOST}_scheduler
domainname: buildhub.local
depends_on:
- apache2
- mysql
- php
volumes:
- ./target-sbin:/usr/local/sbin:ro
- ./service/scheduler/bin:/usr/local/bin:ro
- ./service/scheduler/conf:/usr/local/conf:ro
- ${IPB_ROOT}:/var/www/ipb
- ./data/log:/var/log
- ./data/run:/run
- /run/docker.sock:/run/docker.sock
restart: on-failure
command: ['bin/scheduler.py']
environment:
VHOST: ${VHOST}
# Redis Service for Local Data Cache
redis:
image: debian:${DEBIAN_VERSION}-extended
hostname: redis
container_name: ${VHOST}_redis
depends_on:
- mysql
restart: on-failure
volumes:
- ./target-sbin:/usr/local/sbin:ro
- ./service/redis/bin:/usr/local/bin:ro
- redis_data:/var/lib/redis
- ./data/log:/var/log
- ./data/run:/run
secrets:
- redis-pwd
secrets:
authorized_keys:
file: .secrets/authorized_keys
redis-pwd:
file: .secrets/redis-pwd
forum-token:
file: .secrets/forum-token
volumes:
mysql_data:
external: true
name: ${VHOST}_mysql_data
redis_data:
external: true
name: ${VHOST}_redis_data