-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
executable file
·81 lines (73 loc) · 2.23 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
version: '3'
services:
nginx:
image: nginx:stable-alpine
container_name: ${APP_NAME}-nginx
restart: unless-stopped
ports:
- ${NGINX_PORT}:80
volumes:
- ./wordpress:/var/www/html
- ./.docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- wordpress
links:
- wordpress
mysql:
image: mariadb:10.11
container_name: ${APP_NAME}-mysql
volumes: # data to map to the container
- decimus_wordpress_data:/var/lib/mysql
#- ./db/db.sql:/docker-entrypoint-initdb.d/db.sql
restart: unless-stopped
environment: # mysql options
#- MYSQL_RANDOM_ROOT_PASSWORD: 1
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
- MYSQL_DATABASE=${DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
ports:
- "33060:3306"
wordpress:
container_name: ${APP_NAME}-wordpress
build:
context: ./.docker/wordpress
dockerfile: Dockerfile
restart: unless-stopped
volumes:
- ./wordpress:/var/www/html:cached
- ./.docker/php/php.ini:/usr/local/etc/php/php.ini
depends_on:
- mysql
environment:
- WORDPRESS_DB_HOST=db:${MYSQL_PORT}
- WORDPRESS_DB_USER=${DB_USER}
- WORDPRESS_DB_PASSWORD=${DB_PASSWORD} # matches the password set in the db container
- WORDPRESS_DB_NAME=${DB_NAME}
- WORDPRESS_DEBUG=true
# Point the IP of the Nginx container to the WordPress site URL to make the loopback work
# https://devops.stackexchange.com/questions/12957/wordpress-site-health-errors-when-using-docker-and-nginx
# Use the bridge network's IP address instead:
# 172.17.0.1 -> docker network inspect -v bridge
extra_hosts:
- localhost:172.17.0.1
- decimus.local:172.17.0.1
- host.docker.internal:host-gateway
phpmyadmin:
depends_on:
- mysql
image: phpmyadmin/phpmyadmin
container_name: "${APP_NAME}-phpmyadmin"
restart: unless-stopped
environment:
PMA_HOST: mysql:${MYSQL_PORT}
ports:
- ${PHPMYADMIN_PORT}:80
mailcatcher:
restart: on-failure
image: sj26/mailcatcher:v0.10.0
ports:
- "1081:1080"
- "1026:1025"
volumes:
decimus_wordpress_data: {} # persist db data in native named volume