Files
wxmp_backend/docker-compose.yml
broccoliandClaude Fable 5 1d946046d2 feat: 微信登录与认证完善 + 一键 docker compose 启动
登录流程(以 openid 为唯一标识):
- auth.service.login 改为 upsert:openid 在库续登,不在库自动建用户签 token
- 个人主体无 getPhoneNumber 权限,故不强制手机号注册;register 接口保留备未来用
- wechat.service 新增 getAccessToken(Redis 缓存)、getPluginOpenPid、getUserPhoneNumber
- 新增 /api/wechat/plugin-openpid、/api/wechat/phone 接口

schema 与迁移:
- User 增加 openpid(可空唯一) 兼容插件场景;openid 保持必填主键
- 新增 add_openpid_optional_openid、openid_required_primary 迁移

部署:
- docker-compose.yml 改为 docker compose up -d 一键启动 postgres+redis+app
- app 容器内用服务名连 db/redis,启动自动跑 prisma migrate deploy
- 端口统一 3090(Dockerfile EXPOSE、compose 映射同步)
- 新增 docs/wechat-api-signature-guide.md API 签名手册

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

58 lines
1.4 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 一键启动:docker compose up -d
# 同时起 postgres + redis + appapp 启动前自动跑 prisma migrate deploy
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:
build:
context: .
dockerfile: docker/Dockerfile
container_name: wxmp-app
restart: unless-stopped
env_file: .env
# 容器内用服务名连 db/redis,覆盖 .env 里的 localhost
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/wxmp?schema=public
REDIS_URL: redis://redis:6379
ports:
- "3090:3090"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
wxmp_pg_data:
wxmp_redis_data: