docker-compose.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. # PIN container's listening port to 3000. `PORT` in .env is the HOST
  24. # port for the mapping above ("${PORT:-13000}:3000") — it must NOT reach
  25. # Next.js inside the container, or `next start` reads PORT=13000 and
  26. # listens on the wrong port, so both the 13000->3000 mapping and the
  27. # HEALTHCHECK (which probes :3000) miss it → container goes unhealthy
  28. # and the WebUI is unreachable. `environment` overrides `env_file`, so
  29. # this neutralizes the PORT leaked by env_file below.
  30. - PORT=3000
  31. - OUTPUT_DIR=${OUTPUT_DIR:-/app/output}
  32. - OUTPUT_RETENTION_DAYS=${OUTPUT_RETENTION_DAYS:-30}
  33. - TZ=${TZ:-Asia/Shanghai}
  34. - TIMEZONE=${TIMEZONE:-Asia/Shanghai}
  35. volumes:
  36. - ./output:/app/output
  37. # Bind mount (pre-created as uid 1000 on the host) instead of a named
  38. # volume: named volumes are root-owned, which the non-root container
  39. # (uid 1000) below couldn't write to. .data is gitignored.
  40. - ./.data/pipeline-jobs:/tmp/pipeline-jobs
  41. # Use public DNS resolvers directly. The container inherits the host's
  42. # resolver, which can silently fail to resolve some public domains (e.g.
  43. # open.feishu.cn behind a VPN/proxy) and break the Feishu webhook. Override
  44. # via DNS_SERVER_1/DNS_SERVER_2 in .env if you need an internal resolver.
  45. dns:
  46. - ${DNS_SERVER_1:-223.5.5.5}
  47. - ${DNS_SERVER_2:-114.114.114.114}
  48. restart: unless-stopped