-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
69 lines (64 loc) · 1.65 KB
/
docker-compose.yml
File metadata and controls
69 lines (64 loc) · 1.65 KB
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
version: "3.8"
services:
# 1. 数据库服务
db:
image: mysql:8.0
container_name: bishe_mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
# 建议:不要把 MySQL 直接暴露到公网
ports:
- "127.0.0.1:3306:3306"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
volumes:
- ./data/mysql:/var/lib/mysql
networks:
- bishe-net
# 2. 后端服务
backend:
build: ./backend
container_name: bishe_backend
restart: always
depends_on:
- db
# 建议:后端不直接对公网开端口,交给 1Panel 反代
ports:
- "127.0.0.1:5000:5000"
environment:
DB_HOST: ${DB_HOST} # db
DB_USER: ${DB_USER} # root
DB_PASSWORD: ${DB_PASSWORD}
SITE_DOMAIN: ${SITE_DOMAIN}
ZHIPU_API_KEY: ${ZHIPU_API_KEY}
ZHIPU_MODEL: ${ZHIPU_MODEL}
ZHIPU_API_URL: ${ZHIPU_API_URL}
ZHIPU_VISION_MODEL: ${ZHIPU_VISION_MODEL}
volumes:
- ./backend/app/static:/app/app/static
networks:
- bishe-net
# 3. 前端服务 (Nginx)
frontend:
build: ./frontend
container_name: bishe_frontend
restart: always
depends_on:
- backend
# 建议:前端不直接占 80,交给 1Panel 反代到 8080
ports:
- "127.0.0.1:8080:80"
networks:
- bishe-net
# 4. Cloudflared 内网穿透
tunnel:
image: cloudflare/cloudflared
container_name: bishe_tunnel
restart: always
command: tunnel run --token ${CLOUDFLARE_TUNNEL_TOKEN}
networks:
- bishe-net
networks:
bishe-net:
driver: bridge