mirror of
https://github.com/touwaeriol/sub2apipay.git
synced 2026-08-28 18:18:05 +08:00
6f1621937a
让应用容器绑定 0.0.0.0,并为当前部署环境补齐外部网络接入,修复反向代理访问与 Sub2API 联通问题。
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
# 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
|
||
- HOSTNAME=0.0.0.0
|
||
depends_on:
|
||
db:
|
||
condition: service_healthy
|
||
networks:
|
||
- default
|
||
- sub2api-network
|
||
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:
|
||
|
||
networks:
|
||
sub2api-network:
|
||
external: true
|
||
name: deploy_default
|