Files
inkreach-official-website/deploy/docker-compose.v2.yml
T

75 lines
1.9 KiB
YAML
Raw 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.
# v2 部署(refactor/v2 分支):与现网 deploy 项目完全隔离(独立库/独立卷/独立网络),
# 对外复用 official.inkreach.cc 域名,由现网 nginx 按路径分流:
# https://official.inkreach.cc/v2/admin/ -> 本栈 adminSPA
# https://official.inkreach.cc/v2-api/ -> 本栈 api(去掉前缀后转发)
# 本栈两容器挂到外部网络 inkreach-shared,与 deploy-admin-1 互通(别名 v2-api / v2-admin)。
name: deploy-v2
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: inkreach
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: inkreach
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U inkreach -d inkreach"]
interval: 10s
timeout: 5s
retries: 10
networks:
- default
api:
build:
context: ..
dockerfile: deploy/api.Dockerfile
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
NODE_ENV: production
PORT: 3001
DATABASE_URL: postgresql://inkreach:${POSTGRES_PASSWORD}@postgres:5432/inkreach
JWT_SECRET: ${JWT_SECRET}
CORS_ORIGINS: "*"
# 激活 product-family 聚合公开读路径(现网 v1 未设置,保持旧行为,便于对比)
PUBLIC_DETAIL_FROM_FAMILY: "true"
volumes:
- uploads:/app/uploads
networks:
default:
shared:
aliases:
- v2-api
admin:
build:
context: ..
dockerfile: deploy/admin.Dockerfile
args:
VITE_API_BASE: /v2-api/
restart: unless-stopped
depends_on:
- api
volumes:
- ./nginx/admin.v2.conf:/etc/nginx/conf.d/default.conf:ro
networks:
default:
shared:
aliases:
- v2-admin
networks:
default:
shared:
external: true
name: inkreach-shared
volumes:
pgdata:
uploads: