furniture-3d-system-Wu/docker-compose.prod.yml
WuYongJie 75db836d29 feat(3D核心功能): 完成所有必需实现任务
- 文件上传验证: ModelUploader组件增强、上传API错误处理
- GLTF解析器: 增强节点提取和元数据
- 板材编辑: PanelEditor客户端验证 + panels API服务端验证
- 装配步骤编辑: 修复未使用代码,添加预览按钮
- 装配动画播放: AssemblyPlayer步骤导航边界检查优化
- 分享链接: 完整CRUD API(创建、获取、删除),含验证和过期检查

跳过可选测试任务以加快MVP开发
2025-12-22 16:18:13 +08:00

149 lines
3.7 KiB
YAML

version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: furniture3d-app
restart: unless-stopped
env_file:
- .env
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
minio:
condition: service_healthy
ports:
- "${WEB_PORT:-3001}:3000"
environment:
NODE_ENV: production
PORT: 3000
DATABASE_URL: postgresql://furniture:furniture123@postgres:5432/furniture_db?schema=public
S3_ENDPOINT: http://minio:9000
S3_PUBLIC_ENDPOINT: http://192.168.42.252:9002
S3_REGION: us-east-1
S3_ACCESS_KEY: minioadmin
S3_SECRET_KEY: minioadmin123
S3_BUCKET: furniture-3d-models
NEXT_TELEMETRY_DISABLED: "1"
JWT_SECRET: change-me-in-test
mem_limit: 2g
cpus: 2.0
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health?mode=simple"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
command: >
sh -c "
if [ -x ./node_modules/.bin/prisma ]; then ./node_modules/.bin/prisma db push || true; fi;
if [ -x ./node_modules/prisma/build/index.js ]; then node ./node_modules/prisma/build/index.js db push || true; fi;
node server.js
"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
postgres:
image: postgres:15-alpine
container_name: furniture3d-postgres
restart: unless-stopped
environment:
POSTGRES_USER: furniture
POSTGRES_PASSWORD: furniture123
POSTGRES_DB: furniture_db
ports:
- "5433:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
mem_limit: 1g
cpus: 1.0
healthcheck:
test: ["CMD-SHELL", "pg_isready -U furniture -d furniture_db"]
interval: 10s
timeout: 5s
retries: 5
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
redis:
image: redis:7-alpine
container_name: furniture3d-redis
restart: unless-stopped
command: >
redis-server
--maxmemory 256mb
--maxmemory-policy allkeys-lru
ports:
- "6379:6379"
volumes:
- redis_data:/data
mem_limit: 512m
cpus: 0.5
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
minio:
image: minio/minio:latest
container_name: furniture3d-minio
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin123
ports:
- "9002:9000"
- "9003:9001"
volumes:
- minio_data:/data
mem_limit: 512m
cpus: 0.5
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
minio-setup:
image: minio/mc:latest
container_name: furniture3d-minio-setup
depends_on:
minio:
condition: service_healthy
environment:
MC_HOST_minio: http://minioadmin:minioadmin123@minio:9000
entrypoint: ["sh", "-c"]
command: >
"mc alias set myminio http://minio:9000 minioadmin minioadmin123 && \
mc mb -p myminio/furniture-3d-models || true && \
mc anonymous set download myminio/furniture-3d-models || true && \
echo 'MinIO bucket ready' && sleep 1"
restart: "no"
volumes:
postgres_data:
redis_data:
minio_data: