This repository has been archived by the owner on Dec 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
docker-compose-template.yml
149 lines (142 loc) · 4.72 KB
/
docker-compose-template.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
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
### Notes
#
# - using the 'build' config instead of 'image' allows to build the platform with just 'docker-compose build'
# - SYS_PTRACE capability is needed to allow tghe containers to read /proc/$PID, which is needed by init scripts
#
# The docker-compose 'service' name corresponds to the top-level yml keys, whereas the container name is used in most
# 'docker' commands.
# Keeping a separate container name for each project allows to run many container platforms in parallel
version: '2'
services:
web:
extends:
file: ${DOCKER_WEB_SERVER}.yml
service: ${DOCKER_WEB_SERVER}
hostname: ${DOCKER_PROJECT_NAME}_web
container_name: web
ports:
- "82:82"
- "88:88"
volumes:
- "$DOCKER_WWW_ROOT:$DOCKER_WWW_DEST"
- "$DOCKER_STORAGE_LOCAL_PATH:$DOCKER_STORAGE_MOUNT_POINT"
env_file:
- docker-compose.env
- docker-compose.env.local
cap_add:
- SYS_PTRACE
cli:
image: klabs/php_cli:${DOCKER_PHP_VERSION}
hostname: ${DOCKER_PROJECT_NAME}_cli
container_name: cli
privileged: true
volumes:
- ./logs/cli:/var/log/php
# files in /tmp/cron.d get managed by bootstrap.sh
- ./config/cli/cron.d:/tmp/cron.d
- ~/.gitconfig:/home/site/.gitconfig
- ~/.ssh/config:/home/site/.ssh/config
- "$SSH_AUTH_SOCK:/ssh-agent"
- "./config/cli/php5/custom_vars.ini:$DOCKER_PHP_CONF_PATH/cli/conf.d/custom_vars.ini"
- "./config/cli/php5/timezone.ini:$DOCKER_PHP_CONF_PATH/cli/conf.d/timezone.ini"
- "$DOCKER_WWW_ROOT:$DOCKER_WWW_DEST"
- "$DOCKER_STORAGE_LOCAL_PATH:$DOCKER_STORAGE_MOUNT_POINT"
environment:
- SSH_AUTH_SOCK=/ssh-agent
env_file:
- docker-compose.env
- docker-compose.env.local
cap_add:
- SYS_PTRACE
memcached:
image: klabs/memcached
hostname: ${DOCKER_PROJECT_NAME}_memcached
container_name: memcached
ports:
- "11211:11211"
volumes:
- ./logs/memcache/:/var/log/memcache
env_file:
- docker-compose.env
- docker-compose.env.local
cap_add:
- SYS_PTRACE
solr:
image: klabs/solr:${DOCKER_SOLR_VERSION}
hostname: ${DOCKER_PROJECT_NAME}_solr
container_name: solr
ports:
- "8983:8983"
volumes:
- "${DOCKER_SOLR_CONF_PATH}:/opt/solr/solr/"
- ./data/solr/:/opt/solr/data/
- ./logs/solr/:/opt/solr/logs
env_file:
- docker-compose.env
- docker-compose.env.local
cap_add:
- SYS_PTRACE
varnish:
image: klabs/varnish
hostname: ${DOCKER_PROJECT_NAME}_varnish
container_name: varnish
ports:
- "81:81"
volumes:
- "${DOCKER_VARNISH_VCL_FILE}:/etc/varnish/default.vcl"
- ./logs/varnish/:/var/log/varnish
env_file:
- docker-compose.env
- docker-compose.env.local
cap_add:
- SYS_PTRACE
# varnish init daemon wants to set ulimits
- SYS_RESOURCE
security_opt:
- apparmor:unconfined
depends_on:
- web
- cli
haproxy:
image: klabs/haproxy
hostname: ${DOCKER_PROJECT_NAME}_haproxy
container_name: haproxy
ports:
- "80:80"
volumes:
- ./config/haproxy/haproxy.cfg:/etc/haproxy/haproxy.cfg
env_file:
- docker-compose.env
- docker-compose.env.local
depends_on:
- web
- varnish
- solr
mysql:
image: klabs/mysql
hostname: ${DOCKER_PROJECT_NAME}_mysql
container_name: mysql
# nb: this prevents the image to start on some ubuntu installs because of apparmor config...
#privileged: true
ports:
- "3307:3306"
volumes:
- ./config/mysql/:/etc/mysql/conf.d/
- ./data/mysql/:/var/lib/mysql
- ./logs/mysql/:/var/log/mysql
env_file:
- docker-compose.env
- docker-compose.env.local
cap_add:
- SYS_PTRACE
command: ["/root/bootstrap.sh", "mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci"]
# official phpmyadmin image
phpmyadmin:
image: phpmyadmin/phpmyadmin
hostname: ${DOCKER_PROJECT_NAME}_phpmyadmin
container_name: phpmyadmin
env_file:
- docker-compose.env
- docker-compose.env.local
depends_on:
- mysql