-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.new.yml
More file actions
69 lines (64 loc) · 1.5 KB
/
docker-compose.new.yml
File metadata and controls
69 lines (64 loc) · 1.5 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:
# MySQL 数据库
mysql:
image: mysql:8.0
container_name: woniunote-mysql
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: woniunote
MYSQL_USER: woniunote
MYSQL_PASSWORD: woniunote123
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
command: --default-authentication-plugin=mysql_native_password
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
# Redis 缓存
redis:
image: redis:7-alpine
container_name: woniunote-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
# FastAPI 后端
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: woniunote-backend
environment:
- DATABASE_URL=mysql+asyncmy://woniunote:woniunote123@mysql:3306/woniunote
- REDIS_URL=redis://redis:6379/0
- SECRET_KEY=your-secret-key-change-in-production
- JWT_SECRET_KEY=jwt-secret-key-change-in-production
ports:
- "5173:5173"
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
volumes:
- ./backend:/app
- uploads:/app/uploads
# Vue 前端
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: woniunote-frontend
ports:
- "80:80"
depends_on:
- backend
volumes:
mysql_data:
redis_data:
uploads: