48 lines
1.0 KiB
YAML
48 lines
1.0 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# 开发环境后端配置
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
target: base
|
|
environment:
|
|
- NODE_ENV=development
|
|
- BACKEND_PORT=3001
|
|
- REDIS_HOST=redis
|
|
- REDIS_PORT=6379
|
|
- CORS_ORIGIN=http://localhost:3000
|
|
volumes:
|
|
- ./backend/src:/app/src
|
|
- ./backend/package.json:/app/package.json
|
|
- ./logs:/app/logs
|
|
command: ["npm", "run", "dev"]
|
|
|
|
# 开发环境前端配置
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
target: builder
|
|
environment:
|
|
- NODE_ENV=development
|
|
- NEXT_PUBLIC_API_URL=http://localhost:3001
|
|
- WATCHPACK_POLLING=true
|
|
volumes:
|
|
- ./frontend:/app
|
|
- frontend_node_modules:/app/node_modules
|
|
- frontend_next:/app/.next
|
|
command: ["pnpm", "dev"]
|
|
ports:
|
|
- "3000:3000"
|
|
|
|
# 开发环境Redis配置
|
|
redis:
|
|
ports:
|
|
- "6379:6379"
|
|
command: redis-server --appendonly yes
|
|
|
|
volumes:
|
|
frontend_node_modules:
|
|
frontend_next: |