-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (67 loc) · 1.86 KB
/
Copy pathdocker-compose.yml
File metadata and controls
71 lines (67 loc) · 1.86 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
70
71
services:
# ============ PostgreSQL + pgvector ============
postgres:
image: pgvector/pgvector:pg16
environment:
POSTGRES_DB: ${POSTGRES_DB:-reviewmind}
POSTGRES_USER: ${POSTGRES_USER:-reviewmind}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-reviewmind}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-reviewmind}"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
# ============ Redis ============
redis:
image: redis:7-alpine
ports:
- "${REDIS_PORT:-6379}:6379"
command: redis-server --requirepass ${REDIS_PASSWORD:-}
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
restart: unless-stopped
# ============ FastAPI 后端 ============
backend:
image: sxuancoder/reviewmind-backend:latest
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "${BACKEND_PORT:-8000}:8000"
env_file:
- ./backend/.env
volumes:
# 挂载 .env 配置,方便线上修改无需重建镜像
- ./backend/.env:/app/.env:ro
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
# ============ React 前端 (nginx) ============
frontend:
image: sxuancoder/reviewmind-frontend:latest
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-/api/v1}
ports:
- "${FRONTEND_PORT:-80}:80"
volumes:
# 挂载自定义 nginx 配置,方便线上修改无需重建镜像
- ./frontend/nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- backend
restart: unless-stopped
volumes:
pgdata: