-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
89 lines (82 loc) · 2.62 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
version: '3'
services:
varnish:
container_name: ${DOMAIN}_varnish
build:
context: ./services/varnish
args:
ALPINE_VERSION: ${ALPINE_VERSION}
VARNISH_MEMORY: ${VARNISH_MEMORY}
environment:
VIRTUAL_HOST: ${DOMAIN},www.${DOMAIN}
restart: always
depends_on:
- nginx
nginx:
container_name: ${DOMAIN}_nginx
build:
context: ./services/nginx
args:
NGINX_VERSION: ${NGINX_VERSION}
restart: always
volumes:
- code:/code
depends_on:
- php
php:
container_name: ${DOMAIN}_php
build:
context: ./services/php
args:
PHP_VERSION: ${PHP_VERSION}
restart: always
volumes:
- code:/code
depends_on:
- mysql
- wordpress
mysql:
container_name: ${DOMAIN}_mysql
image: mysql:${MYSQL_VERSION}
restart: always
volumes:
- mysql_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
wordpress:
container_name: ${DOMAIN}_wordpress
build:
context: ./services/wordpress
args:
ALPINE_VERSION: ${ALPINE_VERSION}
volumes:
- code:/code
command: sh -c "test -f /code/index.php ||
(set -ex;
curl -o wordpress.tar.gz -fSL \"https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz\";
tar -xzf wordpress.tar.gz --strip-components=1 -C /code;
rm wordpress.tar.gz;
cp /code/wp-config-sample.php /code/wp-config.php;
sed -i \"s/database_name_here/${MYSQL_DATABASE}/g\" /code/wp-config.php;
sed -i \"s/localhost/mysql/g\" /code/wp-config.php;
sed -i \"s/username_here/${MYSQL_USER}/g\" /code/wp-config.php;
sed -i \"s/password_here/${MYSQL_PASSWORD}/g\" /code/wp-config.php;
curl -o w3-total-cache.zip -fSL \"https://downloads.wordpress.org/plugin/w3-total-cache.${W3_TOTAL_CACHE_VERSION}.zip\";
unzip w3-total-cache.zip -d /code/wp-content/plugins/;
rm w3-total-cache.zip;
curl -o /code/wp-admin/wp-cli.phar -fSL \"https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar\";
chown -R www-data:www-data /code;)"
exim:
container_name: ${DOMAIN}_exim
build:
context: ./services/exim
args:
ALPINE_VERSION: ${ALPINE_VERSION}
dns: ${EXIM_DNS}
restart: always
volumes:
code:
mysql_data: