-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
93 lines (87 loc) · 2.56 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
90
91
92
93
version: "3.6"
services:
wordpress:
image: wordpress:${WORDPRESS_VERSION}
container_name: ${COMPOSE_PROJECT_NAME}-wordpress
volumes:
- ./config/php.conf.ini:/usr/local/etc/php/conf.d/php.ini
- ${WORDPRESS_LOCAL_DIR}:${WORDPRESS_CONTAINER_DIR}
- ${WORDPRESS_THEME_LOCAL_DIR}:${WORDPRESS_THEME_CONTAINER_ROOT_DIR}
- ${WORDPRESS_THEME_PLUGIN_LOCAL_DIR}:${WORDPRESS_THEME_PLUGIN_CONTAINER_ROOT_DIR}
environment:
- WORDPRESS_DB_NAME=${DB_NAME}
- WORDPRESS_TABLE_PREFIX=${WORDPRESS_TABLE_PREFIX}
- WORDPRESS_DB_HOST=${COMPOSE_PROJECT_NAME}-mariadb
- WORDPRESS_DB_USER=${DB_USER}
- WORDPRESS_DB_PASSWORD=${DB_PASSWORD}
depends_on:
- mariadb
- adminer
restart: always
ports:
- "${WORDPRESS_PORT}:80"
networks:
- frontend
- backend
mariadb:
image: mariadb:${MARIADB_VERSION}
container_name: ${COMPOSE_PROJECT_NAME}-mariadb
volumes:
- ./mysql:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
- MYSQL_DATABASE=${DB_NAME}
ports:
- "${MARIADB_PORT}:3306"
restart: always
networks:
- backend
adminer:
image: adminer:${ADMINER_VERSION}
container_name: ${COMPOSE_PROJECT_NAME}-adminer
environment:
ADMINER_DESIGN: "pepa-linha"
ports:
- "${ADMINER_PORT}:8080"
restart: always
depends_on:
- mariadb
networks:
- backend
# Command line interface to wordpress
wpcli:
image: wpcli
build: ./wpcli/
container_name: ${COMPOSE_PROJECT_NAME}-wpcli
volumes:
- ${WORDPRESS_LOCAL_DIR}:${WORDPRESS_CONTAINER_DIR}
- ${WORDPRESS_THEME_LOCAL_DIR}:${WORDPRESS_THEME_CONTAINER_ROOT_DIR}
- ${WORDPRESS_THEME_PLUGIN_LOCAL_DIR}:${WORDPRESS_THEME_PLUGIN_CONTAINER_ROOT_DIR}
working_dir: ${WORDPRESS_CONTAINER_DIR}
depends_on:
- wordpress
- mariadb
networks:
- backend
# Check availability of essential services
healthcheck:
image: wpcli
build: ./wpcli/
container_name: ${COMPOSE_PROJECT_NAME}-healthcheck
command: sh -c "/wait"
environment:
- WAIT_HOSTS=mariadb:3306, wordpress:80
- WAIT_BEFORE_HOSTS=${WAIT_BEFORE_HOSTS:-30}
- WAIT_AFTER_HOSTS=${WAIT_AFTER_HOSTS:-15}
- WAIT_HOSTS_TIMEOUT=${WAIT_HOSTS_TIMEOUT:-300}
- WAIT_SLEEP_INTERVAL=${WAIT_SLEEP_INTERVAL:-30}
- WAIT_HOST_CONNECT_TIMEOUT=${WAIT_HOST_CONNECT_TIMEOUT:-30}
networks:
- backend
networks:
frontend:
backend:
volumes:
mysql: