-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
45 lines (41 loc) · 886 Bytes
/
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
version: '3.8'
volumes:
mysql-volume:
services:
app:
build:
context: .
dockerfile: ./docker/php/Dockerfile
volumes:
- ./src/:/var/www/html
environment:
- DB_CONNECTION=mysql
- DB_HOST=db
- DB_PORT=3306
- DB_DATABASE=${DB_NAME}
- DB_USERNAME=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
web:
build:
context: .
dockerfile: ./docker/nginx/Dockerfile
ports:
- ${WEB_PORT}:80
depends_on:
- app
volumes:
- ./src/:/var/www/html
db:
build:
context: .
dockerfile: ./docker/mysql/Dockerfile
ports:
- ${DB_PORT}:3306
environment:
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
TZ: 'Asia/Tokyo'
volumes:
- mysql-volume:/var/lib/mysql