Files
sub2apipay/docker-compose.hub.yml
erio c226b1188d feat: 版本管理 — VERSION 文件 + 构建发布脚本
- VERSION 文件:版本号单一来源(当前 1.0.0)
- docker-compose.hub.yml / app.yml:镜像 tag 改为 \${IMAGE_TAG:-latest}
- scripts/publish.sh:自动读取 VERSION、打双标签(x.y.z + latest)、推送到 Docker Hub
2026-03-01 21:05:51 +08:00

39 lines
1.1 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# docker-compose.hub.yml
# 使用 Docker Hub 镜像部署(含自带 PostgreSQL
# 适合:全新服务器,无现有数据库
#
# 启动IMAGE_TAG=1.0.0 docker compose -f docker-compose.hub.yml up -d
# 更新IMAGE_TAG=1.1.0 docker compose -f docker-compose.hub.yml pull && docker compose -f docker-compose.hub.yml up -d
# 不指定 IMAGE_TAG 时默认使用 latest
services:
app:
image: touwaeriol/sub2apipay:${IMAGE_TAG:-latest}
ports:
- '${APP_PORT:-3001}:3000'
env_file: .env
environment:
- DATABASE_URL=postgresql://sub2apipay:${DB_PASSWORD:-password}@db:5432/sub2apipay
depends_on:
db:
condition: service_healthy
restart: unless-stopped
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: sub2apipay
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
POSTGRES_DB: sub2apipay
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U sub2apipay']
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped
volumes:
pgdata: