-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
60 lines (56 loc) · 1.21 KB
/
docker-compose.yaml
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
version: '3.0'
services:
mysqldb:
container_name: mysql
image: mysql:8.0.32
command: --default-authentication-plugin=mysql_native_password --mysqlx=0
restart: always
networks:
- backnet
environment:
- MYSQL_DATABASE=blog
- MYSQL_ROOT_PASSWORD=123456
- MYSQL_USER=lolik
- MYSQL_PASSWORD=123456
- MYSQL_HOST=localhost
volumes:
- ./data/mysql:/var/lib/mysql
expose:
- 3306
backend:
container_name: fastapi
build: .
restart: always
networks:
- backnet
depends_on:
- mysqldb
environment:
#保持和 mysql一致
- MYSQL_HOST=mysqldb
- MYSQL_USER=root
- MYSQL_PASSWORD=123456
- MYSQL_DATABASE=blog
- dev=false
volumes:
- ./:/code
ports:
- 8000:8000
# expose:
# - 8000
# proxy:
# build: nginx
# restart: always
# ports:
# - 80:80
# depends_on:
# - backend
# volumes:
# - ./static/dist:/usr/share/nginx/html
# - ./uploads:/usr/share/nginx/html/uploads
# - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
# - ./nginx/logs:/var/log/nginx
# networks:
# - backnet
networks:
backnet: