用户服务 4 个 crate 合并为单一 user-service,按 DDD 限界上下文聚合

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
fish
2026-04-26 16:36:04 +08:00
parent 4e004f5a85
commit b5cb9daad7
28 changed files with 489 additions and 1038 deletions

View File

@@ -51,87 +51,20 @@ services:
retries: 5
# ============ 用户微服务 ============
user-login-account:
user-service:
build:
context: ./backend
dockerfile: services/user-service/user-login-account/Dockerfile
container_name: user-login-account-dev
dockerfile: services/user-service/Dockerfile
container_name: user-service-dev
environment:
- RUST_LOG=${RUST_LOG:-debug}
- DATABASE_URL=postgres://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@user-db:5432/user-db
- REDIS_URL=redis://user-redis:6379/0
- SERVICE_NAME=user-login-account
- SERVICE_NAME=user-service
- SERVICE_PORT=8080
- JWT_SECRET=${JWT_SECRET:-dev-secret-key}
ports:
- "${USER_LOGIN_ACCOUNT_PORT:-20111}:8080"
depends_on:
user-db:
condition: service_healthy
user-redis:
condition: service_healthy
networks:
- asset-helper-dev
restart: unless-stopped
user-register-account:
build:
context: ./backend
dockerfile: services/user-service/user-register-account/Dockerfile
container_name: user-register-account-dev
environment:
- RUST_LOG=${RUST_LOG:-debug}
- DATABASE_URL=postgres://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@user-db:5432/user-db
- REDIS_URL=redis://user-redis:6379/0
- SERVICE_NAME=user-register-account
- SERVICE_PORT=8080
ports:
- "${USER_REGISTER_ACCOUNT_PORT:-20112}:8080"
depends_on:
user-db:
condition: service_healthy
user-redis:
condition: service_healthy
networks:
- asset-helper-dev
restart: unless-stopped
user-login-email:
build:
context: ./backend
dockerfile: services/user-service/user-login-email/Dockerfile
container_name: user-login-email-dev
environment:
- RUST_LOG=${RUST_LOG:-debug}
- DATABASE_URL=postgres://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@user-db:5432/user-db
- REDIS_URL=redis://user-redis:6379/0
- SERVICE_NAME=user-login-email
- SERVICE_PORT=8080
- JWT_SECRET=${JWT_SECRET:-dev-secret-key}
ports:
- "${USER_LOGIN_EMAIL_PORT:-20113}:8080"
depends_on:
user-db:
condition: service_healthy
user-redis:
condition: service_healthy
networks:
- asset-helper-dev
restart: unless-stopped
user-register-email:
build:
context: ./backend
dockerfile: services/user-service/user-register-email/Dockerfile
container_name: user-register-email-dev
environment:
- RUST_LOG=${RUST_LOG:-debug}
- DATABASE_URL=postgres://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@user-db:5432/user-db
- REDIS_URL=redis://user-redis:6379/0
- SERVICE_NAME=user-register-email
- SERVICE_PORT=8080
ports:
- "${USER_REGISTER_EMAIL_PORT:-20114}:8080"
- "${USER_SERVICE_PORT:-20110}:8080"
depends_on:
user-db:
condition: service_healthy
@@ -151,10 +84,7 @@ services:
- "${GATEWAY_HTTP_PORT:-18080}:80"
- "${GATEWAY_HTTPS_PORT:-18443}:443"
depends_on:
- user-login-account
- user-register-account
- user-login-email
- user-register-email
- user-service
networks:
- asset-helper-dev
restart: unless-stopped