-
Notifications
You must be signed in to change notification settings - Fork 15
/
docker-compose.yml
98 lines (91 loc) · 2.75 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
94
95
96
97
version: '3.7'
volumes:
vol-wp-content:
vol-wp-images:
vol-wp-db:
networks:
traefik:
external: true
backend:
services:
traefik:
image: traefik:2.10
logging:
options:
max-size: "10m"
max-file: "3"
container_name: traefik
restart: unless-stopped
networks:
- traefik
ports:
- "80:80"
- "443:443"
- "8080:8080"
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.web-secure.address=:443"
- "--certificatesresolvers.myhttpchallenge.acme.httpchallenge=true"
- "--certificatesresolvers.myhttpchallenge.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.myhttpchallenge.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.myhttpchallenge.acme.email=me@mail.com"
- "--certificatesresolvers.myhttpchallenge.acme.storage=/letsencrypt/acme.json"
volumes:
- "./letsencrypt:/letsencrypt"
- /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
db:
image: mariadb:11.0
logging:
options:
max-size: "10m"
max-file: "3"
container_name: mysql
command: --default-authentication-plugin=mysql_native_password
restart: unless-stopped
env_file:
- .env
volumes:
- vol-wp-db:/var/lib/mysql
- ./config/my.cnf:/etc/mysql/conf.d/zzz_my.cnf
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
networks:
- backend
wordpress:
depends_on:
- db
networks:
- traefik
- backend
container_name: wordpress
logging:
options:
max-size: "10m"
max-file: "3"
restart: always
env_file:
- .env
build: ./
ports:
- "127.0.0.1:8081:8080"
volumes:
- ./wp-content:/var/www/wp-content
- ./images:/usr/src/wordpress/images
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./rootfs:/data
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.wordpresscp.rule=Host(`mywp.com`)"
- "traefik.http.routers.wordpresscp.entrypoints=web"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
- "traefik.http.routers.wordpresscp.middlewares=redirect-to-https@docker"
- "traefik.http.routers.wordpresscp-secured.rule=Host(`mywp.com`)"
- "traefik.http.routers.wordpresscp-secured.entrypoints=web-secure"
- "traefik.http.routers.wordpresscp-secured.tls=true"
- "traefik.http.routers.wordpresscp-secured.tls.certresolver=myhttpchallenge"