- 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>
57 lines
1.3 KiB
YAML
57 lines
1.3 KiB
YAML
# 本地开发:仅起 postgres + redis,应用用 npm run start:dev 直连
|
||
# 起容器:docker compose up -d postgres redis
|
||
services:
|
||
postgres:
|
||
image: postgres:16-alpine
|
||
container_name: wxmp-postgres
|
||
restart: unless-stopped
|
||
environment:
|
||
POSTGRES_USER: postgres
|
||
POSTGRES_PASSWORD: postgres
|
||
POSTGRES_DB: wxmp
|
||
ports:
|
||
- "5432:5432"
|
||
volumes:
|
||
- wxmp_pg_data:/var/lib/postgresql/data
|
||
healthcheck:
|
||
test: ["CMD-SHELL", "pg_isready -U postgres -d wxmp"]
|
||
interval: 5s
|
||
timeout: 3s
|
||
retries: 10
|
||
|
||
redis:
|
||
image: redis:7-alpine
|
||
container_name: wxmp-redis
|
||
restart: unless-stopped
|
||
ports:
|
||
- "6379:6379"
|
||
volumes:
|
||
- wxmp_redis_data:/data
|
||
healthcheck:
|
||
test: ["CMD", "redis-cli", "ping"]
|
||
interval: 5s
|
||
timeout: 3s
|
||
retries: 10
|
||
|
||
# 本地开发默认不启动 app;需要时用 profile:
|
||
# docker compose --profile app up -d
|
||
app:
|
||
profiles: ["app"]
|
||
build:
|
||
context: .
|
||
dockerfile: docker/Dockerfile
|
||
container_name: wxmp-app
|
||
restart: unless-stopped
|
||
env_file: .env
|
||
ports:
|
||
- "3000:3000"
|
||
depends_on:
|
||
postgres:
|
||
condition: service_healthy
|
||
redis:
|
||
condition: service_healthy
|
||
|
||
volumes:
|
||
wxmp_pg_data:
|
||
wxmp_redis_data:
|