-
Notifications
You must be signed in to change notification settings - Fork 133
Expand file tree
/
Copy pathdocker-compose.build.yml
More file actions
72 lines (68 loc) · 2.02 KB
/
docker-compose.build.yml
File metadata and controls
72 lines (68 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Aether 部署配置 - 本地构建
# 使用方法:
# 首次构建 base: docker build -f Dockerfile.base -t aether-base:latest .
# Hub 二进制: cd aether-hub && ./build.sh(默认 binary 模式)供发布;deploy.sh 构建 app 时会自动下载
# Hub 镜像发布: cd aether-hub && ./build.sh --image --tag <tag> --push(可选)
# 启动服务: docker compose -f docker-compose.build.yml up -d --build
# 或使用: ./deploy.sh
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 no --save "" --requirepass ${REDIS_PASSWORD}
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
args:
GITHUB_TOKEN: ${GITHUB_TOKEN:-}
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:-2}
# 容器级别设置
TZ: Asia/Shanghai
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: