forked from webandras/docker-wordpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-ssl.yml
83 lines (71 loc) · 2.21 KB
/
docker-compose-ssl.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
version: '3'
services:
db:
image: mysql:8.0
container_name: ${APP_NAME}-db
volumes: # data to map to the container
#- ./db:/docker-entrypoint-initdb.d # where to find the db dump data
- wordpress_ssl_data:/var/lib/mysql
restart: unless-stopped
environment: # mysql options
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
- MYSQL_DATABASE=${DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
# for mysql 8.0, change autentication to native password (legacy)
command: [
'--default-authentication-plugin=mysql_native_password',
'--character-set-server=utf8mb4',
'--collation-server=utf8mb4_unicode_ci'
]
wordpress:
container_name: ${APP_NAME}-wordpress
depends_on:
- db
build:
context: ./.docker/images/wordpress
dockerfile: Dockerfile-ssl # need to install the wp-cli that is missing from the official image
ports:
- "8080:80"
restart: unless-stopped
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
volumes:
- ./src:/var/www/html:cached
nginx:
container_name: ${APP_NAME}-nginx
image: nginx:stable
depends_on:
- wordpress
volumes:
- "./.docker/images/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf"
- "./.docker/images/nginx/ssl/${APP_DOMAIN}.pem:/etc/nginx/${APP_DOMAIN}.pem"
- "./.docker/images/nginx/ssl/${APP_DOMAIN}-key.pem:/etc/nginx/${APP_DOMAIN}-key.pem"
- "/var/log/nginx:/var/log/nginx"
ports:
- "80:80"
- "443:443"
links:
- wordpress
restart: unless-stopped
phpmyadmin:
depends_on:
- db
image: phpmyadmin/phpmyadmin
container_name: "${APP_NAME}-phpmyadmin"
restart: unless-stopped
environment:
PMA_HOST: db:${MYSQL_PORT}
ports:
- ${PHPMYADMIN_PORT}:80
mailcatcher:
image: sj26/mailcatcher
container_name: "${APP_NAME}-mailcatcher"
ports:
- "1080:1080"
volumes:
wordpress_ssl_data: {} # persist db data in native named volume