2026-04-15 02:11:32 +08:00
|
|
|
# Aether 部署配置 - 使用预构建镜像
|
2026-01-03 01:39:45 +08:00
|
|
|
# 使用方法: docker compose up -d
|
2025-12-10 20:52:44 +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
|
2026-04-15 02:11:32 +08:00
|
|
|
command: postgres -c idle_in_transaction_session_timeout=30000 -c tcp_keepalives_idle=30 -c tcp_keepalives_interval=10
|
2025-12-10 20:52:44 +08:00
|
|
|
healthcheck:
|
2026-01-07 16:38:46 +08:00
|
|
|
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
|
2025-12-10 20:52:44 +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-10 20:52:44 +08:00
|
|
|
healthcheck:
|
2026-04-05 20:23:16 +08:00
|
|
|
test: [ "CMD-SHELL", "redis-cli -a \"${REDIS_PASSWORD}\" ping | grep -q PONG" ]
|
2025-12-10 20:52:44 +08:00
|
|
|
interval: 5s
|
|
|
|
|
timeout: 3s
|
|
|
|
|
retries: 5
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
|
|
app:
|
2026-04-11 10:48:34 +08:00
|
|
|
image: ${APP_IMAGE:-ghcr.io/fawney19/aether:pre}
|
2025-12-10 20:52:44 +08:00
|
|
|
container_name: aether-app
|
2026-01-07 15:19:55 +08:00
|
|
|
env_file:
|
|
|
|
|
- .env
|
2025-12-10 20:52:44 +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-05 20:23:16 +08:00
|
|
|
AETHER_LOG_DESTINATION: ${AETHER_LOG_DESTINATION:-both}
|
2026-04-16 02:13:27 +08:00
|
|
|
AETHER_LOG_FORMAT: ${AETHER_LOG_FORMAT:-pretty}
|
2026-04-05 20:23:16 +08:00
|
|
|
AETHER_LOG_DIR: ${AETHER_LOG_DIR:-/app/logs}
|
|
|
|
|
AETHER_LOG_ROTATION: ${AETHER_LOG_ROTATION:-daily}
|
|
|
|
|
AETHER_LOG_RETENTION_DAYS: ${AETHER_LOG_RETENTION_DAYS:-7}
|
|
|
|
|
AETHER_LOG_MAX_FILES: ${AETHER_LOG_MAX_FILES:-30}
|
2026-04-11 17:39:02 +08:00
|
|
|
APP_PORT: ${APP_PORT:-8084}
|
2026-04-22 18:20:24 +08:00
|
|
|
AETHER_GATEWAY_AUTO_PREPARE_DATABASE: ${AETHER_GATEWAY_AUTO_PREPARE_DATABASE:-true}
|
2025-12-10 20:52:44 +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-10 20:52:44 +08:00
|
|
|
volumes:
|
|
|
|
|
- ./logs:/app/logs
|
2026-04-15 02:11:32 +08:00
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD", "aether-gateway", "health", "--url", "http://127.0.0.1:${APP_PORT:-8084}/health"]
|
|
|
|
|
interval: 30s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 3
|
|
|
|
|
start_period: 60s
|
2025-12-10 20:52:44 +08:00
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
postgres_data:
|
2026-04-05 20:23:16 +08:00
|
|
|
redis_data:
|