-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
executable file
·86 lines (73 loc) · 1.96 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
version: '3.1'
services:
# Proxy ports to more convenient subdomains with Traefik
traefik:
image: traefik:latest
command:
- --log.level=INFO
- --api.insecure=true
- --entrypoints.web.address=:80
- --providers.docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- traefik.http.routers.dash.rule=Host(`dash.localhost`)
- traefik.http.routers.dash.service=api@internal
ports:
- "80:80"
db:
image: mysql:latest
container_name: mysql
restart: always
environment:
MYSQL_DATABASE: wordpress_database
MYSQL_USER: wordpress_user
MYSQL_PASSWORD: wordpress_password
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
volumes:
- ./db:/var/lib/mysql
# Mailhog catches mails sent via sendmail
mailhog:
image: mailhog/mailhog
ports:
- 1025:1025
- 8025:8025
labels:
- traefik.http.routers.mailhog.rule=Host(`mail.localhost`)
- traefik.http.services.mailhog.loadbalancer.server.port=8025
phpmyadmin:
image: phpmyadmin
container_name: phpmyadmin
environment:
- PMA_ARBITRARY=1
restart: always
depends_on:
- db
ports:
- 8080:8080
labels:
- traefik.http.routers.phpmyadmin.rule=Host(`db.localhost`)
volumes:
- /sessions
# Custom docker file to use sendmail with mailhog
wordpress:
container_name: wordpress
build:
context: ./docker
dockerfile: dockerfile-wordpress
restart: always
depends_on:
- db
ports:
- 8081:8081
labels:
- traefik.http.routers.wordpress.rule=Host(`localhost`)
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress_user
WORDPRESS_DB_PASSWORD: wordpress_password
WORDPRESS_DB_NAME: wordpress_database
volumes:
- ./public_html:/var/www/html