2025-12-11 18:16:19 +08:00
|
|
|
# Aether 部署配置 - 本地构建
|
|
|
|
|
# 使用方法:
|
2026-01-03 01:39:45 +08:00
|
|
|
# 启动服务: docker compose -f docker-compose.build.yml up -d --build
|
2026-03-02 11:24:14 +08:00
|
|
|
# 或使用: ./deploy.sh
|
2025-12-11 18:16:19 +08:00
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
postgres:
|
|
|
|
|
image: postgres:15
|
|
|
|
|
container_name: aether-postgres
|
|
|
|
|
environment:
|
|
|
|
|
POSTGRES_DB: aether
|
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
|
|
|
TZ: Asia/Shanghai
|
|
|
|
|
volumes:
|
|
|
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
|
ports:
|
|
|
|
|
- "${DB_PORT:-5432}:5432"
|
|
|
|
|
healthcheck:
|
2026-01-07 16:38:46 +08:00
|
|
|
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
|
2025-12-11 18:16:19 +08:00
|
|
|
interval: 5s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 5
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
|
|
redis:
|
|
|
|
|
image: redis:7-alpine
|
|
|
|
|
container_name: aether-redis
|
2026-04-05 20:23:16 +08:00
|
|
|
command: redis-server --appendonly yes --appendfsync everysec --save 60 1000 --requirepass ${REDIS_PASSWORD}
|
|
|
|
|
volumes:
|
|
|
|
|
- redis_data:/data
|
2025-12-11 18:16:19 +08:00
|
|
|
ports:
|
|
|
|
|
- "${REDIS_PORT:-6379}:6379"
|
|
|
|
|
healthcheck:
|
2026-04-05 20:23:16 +08:00
|
|
|
test: [ "CMD-SHELL", "redis-cli -a \"${REDIS_PASSWORD}\" ping | grep -q PONG" ]
|
2025-12-11 18:16:19 +08:00
|
|
|
interval: 5s
|
|
|
|
|
timeout: 3s
|
|
|
|
|
retries: 5
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
|
|
app:
|
|
|
|
|
build:
|
|
|
|
|
context: .
|
2025-12-19 16:20:02 +08:00
|
|
|
dockerfile: Dockerfile.app.local
|
2025-12-11 18:16:19 +08:00
|
|
|
image: aether-app:latest
|
|
|
|
|
container_name: aether-app
|
2026-01-07 15:19:55 +08:00
|
|
|
env_file:
|
|
|
|
|
- .env
|
2025-12-11 18:16:19 +08:00
|
|
|
environment:
|
|
|
|
|
DATABASE_URL: postgresql://postgres:${DB_PASSWORD}@postgres:5432/aether
|
|
|
|
|
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379/0
|
|
|
|
|
TZ: Asia/Shanghai
|
2026-04-11 17:39:02 +08:00
|
|
|
APP_PORT: ${APP_PORT:-8084}
|
2026-04-22 22:16:51 +08:00
|
|
|
AETHER_GATEWAY_AUTO_PREPARE_DATABASE: ${AETHER_GATEWAY_AUTO_PREPARE_DATABASE:-true}
|
2025-12-11 18:16:19 +08:00
|
|
|
depends_on:
|
|
|
|
|
postgres:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
redis:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
ports:
|
2026-04-11 13:55:11 +08:00
|
|
|
- "${APP_PORT:-8084}:${APP_PORT:-8084}"
|
2025-12-11 18:16:19 +08:00
|
|
|
volumes:
|
|
|
|
|
- ./logs:/app/logs
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
postgres_data:
|
2026-04-05 20:23:16 +08:00
|
|
|
redis_data:
|