-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
51 lines (50 loc) · 925 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
46
47
48
49
50
51
version: "3.7"
# =======================
services:
# web server
web:
container_name: web
image: nginx:1.18
ports:
- "8080:80"
volumes:
- ./src:/var/www/html
- ./docker-file/site.conf:/etc/nginx/conf.d/default.conf
networks:
- network
depends_on:
- php
# php
php:
container_name: php
build:
context: docker-file
dockerfile: Dockerfile
volumes:
- ./src:/var/www/html
networks:
- network
depends_on:
- db
# database
db:
container_name: db
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: database
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- '33061:3306'
networks:
- network
# =======================
volumes:
db_data:
networks:
network:
driver: bridge