mirror of
https://github.com/fawney19/Aether.git
synced 2026-01-09 03:02:26 +08:00
74 lines
1.8 KiB
YAML
74 lines
1.8 KiB
YAML
# Aether 部署配置 - 本地构建
|
|
# 使用方法:
|
|
# 首次构建 base: docker build -f Dockerfile.base -t aether-base:latest .
|
|
# 启动服务: docker compose -f docker-compose.build.yml up -d --build
|
|
|
|
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:
|
|
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
|
|
ports:
|
|
- "${REDIS_PORT:-6379}:6379"
|
|
healthcheck:
|
|
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.app.local
|
|
image: aether-app: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:
|