mirror of
https://github.com/fawney19/Aether.git
synced 2026-01-09 03:02:26 +08:00
65 lines
1.6 KiB
YAML
65 lines
1.6 KiB
YAML
# 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
|
|
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 --requirepass ${REDIS_PASSWORD}
|
|
volumes:
|
|
- redis_data:/data
|
|
healthcheck:
|
|
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
app:
|
|
image: ghcr.io/fawney19/aether:latest
|
|
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
|
|
# Supervisor 需要的变量
|
|
GUNICORN_WORKERS: ${GUNICORN_WORKERS:-4}
|
|
# 容器级别设置
|
|
TZ: Asia/Shanghai
|
|
PYTHONIOENCODING: utf-8
|
|
LANG: C.UTF-8
|
|
LC_ALL: C.UTF-8
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
ports:
|
|
- "${APP_PORT:-8084}:80"
|
|
volumes:
|
|
- ./logs:/app/logs
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|