# Aether 部署配置 - 使用预构建镜像 # 使用方法: docker compose up -d 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 command: postgres -c idle_in_transaction_session_timeout=30000 -c tcp_keepalives_idle=30 -c tcp_keepalives_interval=10 healthcheck: test: [ "CMD-SHELL", "pg_isready -U postgres" ] interval: 5s timeout: 5s retries: 5 restart: unless-stopped redis: image: redis:7-alpine container_name: aether-redis command: redis-server --appendonly yes --appendfsync everysec --save 60 1000 --requirepass ${REDIS_PASSWORD} volumes: - redis_data:/data healthcheck: test: [ "CMD-SHELL", "redis-cli -a \"${REDIS_PASSWORD}\" ping | grep -q PONG" ] interval: 5s timeout: 3s retries: 5 restart: unless-stopped app: image: ${APP_IMAGE:-ghcr.io/fawney19/aether:pre} container_name: aether-app env_file: - .env environment: DATABASE_URL: postgresql://postgres:${DB_PASSWORD}@postgres:5432/aether REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379/0 TZ: Asia/Shanghai AETHER_LOG_DESTINATION: ${AETHER_LOG_DESTINATION:-both} AETHER_LOG_FORMAT: ${AETHER_LOG_FORMAT:-pretty} 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} APP_PORT: ${APP_PORT:-8084} AETHER_GATEWAY_AUTO_PREPARE_DATABASE: ${AETHER_GATEWAY_AUTO_PREPARE_DATABASE:-true} depends_on: postgres: condition: service_healthy redis: condition: service_healthy ports: - "${APP_PORT:-8084}:${APP_PORT:-8084}" volumes: - ./logs:/app/logs 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 restart: unless-stopped volumes: postgres_data: redis_data: