Files
wxmp_backend/docker-compose.prod.yml
T
broccoliandClaude Fable 5 deaa0c9ce4 feat: 初始化微信小程序后端骨架
- NestJS + TypeScript + Prisma + PostgreSQL 工程骨架
- 微信登录安全流程:服务端 code2Session 换 openid 后签发 JWT,
  session_key 缓存于 Redis,不信任前端 openid
- 统一响应/异常处理、JWT 全局鉴权(@Public 豁免)、Swagger 文档
- Prisma 全量核心 schema(用户/分类/商品/设计清单/地址/订单/支付/上传/定制任务)+ seed
- 业务模块空壳(商品/分类/设计清单/地址/订单/支付/上传/BullMQ 队列)
- Docker 多阶段镜像 + 本地/生产 docker-compose
- docs:密钥获取指南、COS SDK 移除记录

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-05 17:33:50 +08:00

53 lines
1.2 KiB
YAML

# 生产参考编排:app + postgres + redis 同机部署
# 实际部署到腾讯云轻量应用服务器时按需调整端口/卷/资源限制
services:
app:
build:
context: .
dockerfile: docker/Dockerfile
container_name: wxmp-app
restart: always
env_file: .env
environment:
NODE_ENV: production
ports:
- "3000:3000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
postgres:
image: postgres:16-alpine
container_name: wxmp-postgres
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB:-wxmp}
volumes:
- wxmp_pg_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 5s
timeout: 3s
retries: 10
redis:
image: redis:7-alpine
container_name: wxmp-redis
restart: always
command: ["redis-server", "--appendonly", "yes"]
volumes:
- wxmp_redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
volumes:
wxmp_pg_data:
wxmp_redis_data: