-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
49 lines (46 loc) · 1.05 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
services:
private-website:
image: saltwood233/private-website:dev
volumes:
- ./data:/app/data
- ./assets:/app/assets
env_file:
- .env
environment:
- IS_IN_DOCKER=true
- TZ=Asia/Shanghai
networks:
- internal_network
ports:
- "127.0.0.1:2500:2500"
restart: unless-stopped
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '10'
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: rootroot
MYSQL_DATABASE: private_website_db
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
networks:
- internal_network
restart: unless-stopped
# 仅在容器内网暴露 MySQL 服务
ports:
- "127.0.0.1:3306:3306" # 暴露到宿主机端口 3306,可取消注释暴露到公网
volumes:
mysql_data:
driver: local
driver_opts:
type: none
device: ./mysql_data
o: bind
networks:
internal_network:
driver: bridge