update
This commit is contained in:
@ -26,7 +26,7 @@ x-backend-base: &backend-base
|
||||
BACKSTAGE_PORT: 8092
|
||||
GIN_MODE: release
|
||||
|
||||
HASHID_SECRET: ${HASHID_SECRET:?HASHID_SECRET 未设置:复制 .env.example 为 .env 并填写}
|
||||
HASHID_SECRET: ${HASHID_SECRET:-}
|
||||
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET 未设置}
|
||||
SSG_TOKEN: ${SSG_TOKEN:-}
|
||||
CORS_ALLOW_ORIGINS: ${CORS_ALLOW_ORIGINS:-https://xisoa.com,https://www.xisoa.com}
|
||||
@ -35,7 +35,8 @@ x-backend-base: &backend-base
|
||||
RATE_LIMIT_RPS: ${RATE_LIMIT_RPS:-20}
|
||||
RATE_LIMIT_BURST: ${RATE_LIMIT_BURST:-40}
|
||||
|
||||
DB_HOST: db
|
||||
# 复用 1Panel 现有 Postgres(宿主 5432)。host-gateway 让容器经宿主访问它。
|
||||
DB_HOST: host.docker.internal
|
||||
DB_PORT: 5432
|
||||
DB_USER: ${DB_USER:-fashion}
|
||||
DB_PASSWORD: ${DB_PASSWORD:?DB_PASSWORD 未设置}
|
||||
@ -60,9 +61,8 @@ x-backend-base: &backend-base
|
||||
UPLOAD_DIR: /app/uploads
|
||||
volumes:
|
||||
- uploads:/app/uploads
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8090/api/health"]
|
||||
interval: 10s
|
||||
@ -84,29 +84,15 @@ x-web-base: &web-base
|
||||
start_period: 15s
|
||||
|
||||
services:
|
||||
# ---- 数据库:PostgreSQL 16 + pgvector ----
|
||||
db:
|
||||
image: pgvector/pgvector:pg16
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: ${DB_USER:-fashion}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD:?DB_PASSWORD 未设置}
|
||||
POSTGRES_DB: ${DB_NAME:-fashion}
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- db_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-fashion} -d ${DB_NAME:-fashion}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
# ---- 数据库:复用 1Panel 现有 Postgres(连接信息见 .env 的 DB_HOST/DB_PORT/DB_USER/DB_PASSWORD)----
|
||||
|
||||
# ---- 常驻代理:整个发布过程中不重建,切换只靠 reload ----
|
||||
proxy:
|
||||
image: nginx:1.27-alpine
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${HTTP_PORT:-80}:80"
|
||||
# 只绑宿主回环:80/443 由 1Panel OpenResty 占用,外层反代到 127.0.0.1:${HTTP_PORT}
|
||||
- "127.0.0.1:${HTTP_PORT:-8080}:80"
|
||||
- "127.0.0.1:18091:18091" # 前端构建期取 SSG
|
||||
- "127.0.0.1:18092:18092" # 管理后台(SSH 隧道)
|
||||
volumes:
|
||||
@ -151,5 +137,4 @@ services:
|
||||
<<: *web-base
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
uploads:
|
||||
|
||||
Reference in New Issue
Block a user