-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
71 lines (66 loc) · 1.6 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
version: '3.9'
services:
db:
image: mariadb:10.5.9
restart: always
ports:
- '3306:3306'
environment:
MYSQL_ROOT_PASSWORD: 's3cr3t'
MYSQL_USER: 'username'
MYSQL_PASSWORD: 'password'
MYSQL_DATABASE: 'mydb'
volumes:
- db_data:/var/lib/mysql
- ./sql/countries-create.sql:/docker-entrypoint-initdb.d/countries-create.sql:ro
- ./sql/countries-insert.sql:/docker-entrypoint-initdb.d/countries-insert.sql:ro
healthcheck:
test: mysqladmin ping -h 127.0.0.1 -u root --password=s3cr3t
interval: 5s
retries: 5
db_admin:
image: phpmyadmin/phpmyadmin:5
ports:
- '8081:80'
environment:
- PMA_HOST=db
- PMA_ABSOLUTE_URI=http://localhost:8001/
depends_on:
db:
condition: service_healthy
volumes:
- db_admin_data:/var/www/html
app:
build:
context: .
dockerfile: docker/php8-fpm-mysql/Dockerfile
volumes:
- ./conf/php-fpm.d/www.conf:/usr/local/etc/php-fpm.d/www.conf:ro
- ./src:/var/www/html
healthcheck:
test: php-fpm -t
interval: 60s
retries: 5
depends_on:
db:
condition: service_healthy
web:
image: nginx:latest
ports:
- "8080:80"
volumes:
- ./conf/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
- ./src:/var/www/html
working_dir: /var/www/html
healthcheck:
test: curl --fail localhost/ping
interval: 30s
retries: 6
depends_on:
app:
condition: service_healthy
db:
condition: service_healthy
volumes:
db_data:
db_admin_data: