docker-compose.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. services:
  2. pipeline:
  3. build: .
  4. # Run as the image's non-root `node` user by default (uid 1000 == host
  5. # `lkattey` here, and the same user Kubernetes runs the image as, so local
  6. # compose mirrors prod's filesystem ownership). Bind-mounted files (./output,
  7. # ./.data) therefore stay host-accessible instead of root-owned. On a host
  8. # whose uid isn't 1000, set HOST_UID/HOST_GID (in .env or the shell) to your
  9. # numeric uid:gid so the bind mounts match your user.
  10. user: "${HOST_UID:-node}:${HOST_GID:-node}"
  11. ports:
  12. - "${PORT:-13000}:3000"
  13. # Pass EVERY variable from .env (API keys, OSS, Feishu, SCHEDULES,
  14. # SCHEDULER_ENABLED, LOG_LEVEL, …) into the container automatically via
  15. # env_file — no per-variable list to maintain. The previous explicit list
  16. # silently dropped any var not enumerated, so new knobs set in .env never
  17. # reached the container. `environment` below only adds container-specific
  18. # defaults for keys that may be absent from .env, and overrides env_file for
  19. # those keys.
  20. env_file:
  21. - .env
  22. environment:
  23. - OUTPUT_DIR=${OUTPUT_DIR:-/app/output}
  24. - OUTPUT_RETENTION_DAYS=${OUTPUT_RETENTION_DAYS:-30}
  25. - TZ=${TZ:-Asia/Shanghai}
  26. - TIMEZONE=${TIMEZONE:-Asia/Shanghai}
  27. volumes:
  28. - ./output:/app/output
  29. # Bind mount (pre-created as uid 1000 on the host) instead of a named
  30. # volume: named volumes are root-owned, which the non-root container
  31. # (uid 1000) below couldn't write to. .data is gitignored.
  32. - ./.data/pipeline-jobs:/tmp/pipeline-jobs
  33. # Use public DNS resolvers directly. The container inherits the host's
  34. # resolver, which can silently fail to resolve some public domains (e.g.
  35. # open.feishu.cn behind a VPN/proxy) and break the Feishu webhook. Override
  36. # via DNS_SERVER_1/DNS_SERVER_2 in .env if you need an internal resolver.
  37. dns:
  38. - ${DNS_SERVER_1:-223.5.5.5}
  39. - ${DNS_SERVER_2:-114.114.114.114}
  40. restart: unless-stopped