35 lines
1.2 KiB
YAML
35 lines
1.2 KiB
YAML
|
|
# 本地 docker 測試 override(搭配 docker-compose.yml 一起用):
|
|||
|
|
# docker compose -f deploy/docker-compose.yml -f deploy/docker-compose.dev.yml --env-file deploy/.env.dev up -d --build
|
|||
|
|
# 或直接 `make dev-up`。
|
|||
|
|
#
|
|||
|
|
# 與正式版差異:
|
|||
|
|
# - 後端(gateway/init)改用 gateway.dev.example.yaml(DevHeaderFallback=true、不加密)。
|
|||
|
|
# - 掛載 backend/etc,改 yaml 後 restart 容器即可生效,不必 rebuild。
|
|||
|
|
# - gateway 對外開 :8890 方便直接打 API;web 走 .env.dev 的 WEB_PORT(預設 8080)。
|
|||
|
|
# - go job worker 用 gateway 內嵌(不啟動獨立 worker 容器)。
|
|||
|
|
name: haixun
|
|||
|
|
|
|||
|
|
services:
|
|||
|
|
# 本地測試不對外 publish DB port(容器間走 service name),
|
|||
|
|
# 避免與其他本機 Mongo/Redis(含舊 haixun-infra)搶 127.0.0.1:27017。
|
|||
|
|
mongo:
|
|||
|
|
ports: !reset []
|
|||
|
|
|
|||
|
|
init:
|
|||
|
|
command: ["init", "-f", "/app/etc/gateway.dev.example.yaml"]
|
|||
|
|
volumes:
|
|||
|
|
- ../backend/etc:/app/etc:ro
|
|||
|
|
|
|||
|
|
gateway:
|
|||
|
|
command: ["-f", "/app/etc/gateway.dev.example.yaml"]
|
|||
|
|
ports:
|
|||
|
|
- "8890:8890"
|
|||
|
|
volumes:
|
|||
|
|
- ../backend/etc:/app/etc:ro
|
|||
|
|
|
|||
|
|
node-worker:
|
|||
|
|
environment:
|
|||
|
|
HAIXUN_BACKEND_URL: "http://gateway:8890"
|
|||
|
|
HAIXUN_WORKER_SECRET: "haixun-dev-worker-secret"
|
|||
|
|
TZ: "UTC"
|