thread-master/deploy/docker-compose.dev.yml

35 lines
1.2 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.

# 本地 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.yamlDevHeaderFallback=true、不加密
# - 掛載 backend/etc改 yaml 後 restart 容器即可生效,不必 rebuild。
# - gateway 對外開 :8890 方便直接打 APIweb 走 .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"