fefd64957d
- Gitea Secrets 只保留 5 个基础密钥(DB密码、JWT、加密密钥) - 删除 deploy.yml 中所有业务密钥的 secrets 注入 - docker-compose 移除业务环境变量,只保留 DB/JWT/ENCRYPTION_KEY - 业务密钥(微信/支付宝/短信等)通过后台「系统密钥」页面管理 - 改用 export 方式注入环境变量,不再写 .env 文件 - 更新部署文档 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
116 lines
2.4 KiB
YAML
116 lines
2.4 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
mysql:
|
|
image: mysql:8.0
|
|
container_name: rent-test-mysql
|
|
restart: always
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: ${TEST_DB_PASSWORD:-rent123456}
|
|
MYSQL_DATABASE: rent_platform
|
|
MYSQL_CHARSET: utf8mb4
|
|
MYSQL_COLLATION: utf8mb4_unicode_ci
|
|
ports:
|
|
- "3307:3306"
|
|
volumes:
|
|
- mysql_test_data:/var/lib/mysql
|
|
- ../../database/migrations:/docker-entrypoint-initdb.d
|
|
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- rent-test
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: rent-test-redis
|
|
restart: always
|
|
ports:
|
|
- "6380:6379"
|
|
volumes:
|
|
- redis_test_data:/data
|
|
command: redis-server --appendonly yes
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- rent-test
|
|
|
|
server:
|
|
build:
|
|
context: ../..
|
|
dockerfile: deploy/docker/Dockerfile.server
|
|
container_name: rent-test-server
|
|
restart: always
|
|
ports:
|
|
- "3001:3000"
|
|
environment:
|
|
NODE_ENV: test
|
|
PORT: 3000
|
|
DB_HOST: mysql
|
|
DB_PORT: 3306
|
|
DB_USERNAME: root
|
|
DB_DATABASE: rent_platform
|
|
REDIS_HOST: redis
|
|
REDIS_PORT: 6379
|
|
DB_PASSWORD: ${TEST_DB_PASSWORD}
|
|
JWT_SECRET: ${TEST_JWT_SECRET}
|
|
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
|
|
depends_on:
|
|
mysql:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
networks:
|
|
- rent-test
|
|
|
|
merchant-admin:
|
|
build:
|
|
context: ../..
|
|
dockerfile: deploy/docker/Dockerfile.merchant
|
|
container_name: rent-test-merchant
|
|
restart: always
|
|
ports:
|
|
- "9081:80"
|
|
depends_on:
|
|
- server
|
|
networks:
|
|
- rent-test
|
|
|
|
platform-admin:
|
|
build:
|
|
context: ../..
|
|
dockerfile: deploy/docker/Dockerfile.platform
|
|
container_name: rent-test-platform
|
|
restart: always
|
|
ports:
|
|
- "9082:80"
|
|
depends_on:
|
|
- server
|
|
networks:
|
|
- rent-test
|
|
|
|
website:
|
|
build:
|
|
context: ../..
|
|
dockerfile: deploy/docker/Dockerfile.website
|
|
container_name: rent-test-website
|
|
restart: always
|
|
ports:
|
|
- "9083:80"
|
|
networks:
|
|
- rent-test
|
|
|
|
volumes:
|
|
mysql_test_data:
|
|
redis_test_data:
|
|
|
|
networks:
|
|
rent-test:
|
|
name: rent-test
|