collabcentral/Dockerfile
Joseph B. McQueen b4e5ca3f33 Phase 7: polish for production readiness
- Add README with local setup, add-a-bot walkthrough, Docker run
  recipe, and a rundown of committed vs. runtime state.
- Wrap the cron schedules with an explicit timezone (default
  America/New_York, override via CRON_TIMEZONE) so cadence is
  independent of the host/container clock.
- Route saveServiceAccountToken through a try/catch so a disk hiccup
  no longer bubbles up as an unhandled exception during token refresh,
  and keep the in-memory copy usable even on write failure.
- Silence per-message queue.on('active') / on('completed') logs that
  also registered a new listener on every job invocation (accumulating
  on the shared queue over time).
- Fix logIt reference (undefined; would have thrown if
  checkScheduledJobs ever rejected) and a broken JSON.stringify.result
  debug log that always evaluated to undefined.
- Dockerfile: switch to node:20-slim, install from the lockfile via
  npm ci --omit=dev, set NODE_ENV=production, and document that env
  and volumes are supplied at runtime.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 18:00:59 -04:00

23 lines
767 B
Docker

FROM node:20-slim
WORKDIR /usr/src/app
# Install dependencies from the lockfile for reproducible builds.
COPY package*.json ./
RUN npm ci --omit=dev
# Bundle app source. `.dockerignore` deliberately excludes `config/`, `.env`,
# `uploads/`, and other runtime state so the image is stateless.
COPY . .
# Env vars are supplied at runtime, either via `docker run --env-file .env`,
# `-e KEY=VALUE`, or compose/K8s. `config/` and `uploads/` should be mounted
# as volumes so tokens, jobs, and uploaded CSVs persist across restarts.
#
# The listening port is controlled by the SERVER_PORT env var; EXPOSE below
# is informational and should be aligned with whatever SERVER_PORT is set to
# at deploy time.
ENV NODE_ENV=production
EXPOSE 1450
CMD ["node", "index.js"]