-
Notifications
You must be signed in to change notification settings - Fork 19
/
docker-compose.yml
77 lines (72 loc) · 1.78 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
services:
nginx:
container_name: ${CONTAINER_NAME}-nginx
build:
context: .
dockerfile: ./nginx/Dockerfile
restart: unless-stopped
env_file: .env
environment:
HOSTNAME: ${HOSTNAME}
ports:
- "80:80"
- "443:443"
volumes:
- wordpress:/var/www/html
networks:
- internal
database:
container_name: ${CONTAINER_NAME}-database
image: mysql:8.0
restart: unless-stopped
env_file: .env
environment:
MYSQL_DATABASE: ${DATABASE_NAME}
MYSQL_PASSWORD: ${DATABASE_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DATABASE_ROOT_PASSWORD}
MYSQL_USER: ${DATABASE_USER}
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost", "-u", "root", "-p$$DATABASE_ROOT_PASSWORD" ]
timeout: 20s
retries: 10
ports:
- "3306:3306"
volumes:
- dbdata:/var/lib/mysql
networks:
- internal
phpmyadmin:
container_name: ${CONTAINER_NAME}-phpmyadmin
image: phpmyadmin/phpmyadmin
env_file: .env
environment:
PMA_HOST: database
PMA_PORT: 3306
MYSQL_ROOT_PASSWORD: "${DATABASE_ROOT_PASSWORD}"
ports:
- "8081:80"
networks:
- internal
wordpress:
depends_on:
- database
container_name: ${CONTAINER_NAME}-wordpress
image: wordpress:6.5.2-fpm-alpine
restart: unless-stopped
env_file: .env
environment:
WORDPRESS_DB_HOST: database:3306 # use the same name as database service
WORDPRESS_DB_NAME: '${DATABASE_NAME}'
WORDPRESS_DB_USER: '${DATABASE_USER}'
WORDPRESS_DB_PASSWORD: '${DATABASE_PASSWORD}'
volumes:
- wordpress:/var/www/html
- ./src:/var/www/html/wp-content:rw
networks:
- internal
volumes:
dbdata:
wordpress:
networks:
internal:
driver: bridge