wbxcallprov/Dockerfile
jmcqueen 63f35027f6
Some checks failed
CI / verify (push) Has been cancelled
Add daily store phone export to Webex space
Weekday 10am Eastern cron exports all Webex Calling locations whose
name starts with "Store" to a legacy-format CSV (+E164,Store XXXX),
diffs against the previous baseline, and posts the file plus a change
summary to a configured Webex space.

- src/webex/storePhones.js: paginated GET /telephony/config/locations
- src/services/storePhoneExport.js: CSV format, filename, diff, message
- src/webex/messages.js: bot-token multipart POST /messages with file
- src/jobs/storePhoneExport.js + cron in src/index.js
- scripts/exportStorePhones.js for manual runs (npm run export-store-phones)
- Persist baseline + archives under data/store-phone-export/ (gitignored)
- Dockerfile: create /app/data for volume mount in prod
- CI: align node-version with Dockerfile (20)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 14:57:45 -04:00

34 lines
1.1 KiB
Docker

# syntax=docker/dockerfile:1.7
# --- build stage: install production dependencies only ---
FROM node:20-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --omit=dev --no-audit --no-fund
# --- runtime stage: minimal image with just what's needed to run ---
FROM node:20-alpine AS runtime
ENV NODE_ENV=production
WORKDIR /app
# Bring in dependencies (owned by the built-in `node` user).
COPY --from=deps --chown=node:node /app/node_modules ./node_modules
# Application code.
COPY --chown=node:node package.json package-lock.json ./
COPY --chown=node:node src ./src
COPY --chown=node:node greetings ./greetings
# Directory the token-refresh cron writes to. Mount a volume here in prod.
RUN mkdir -p /app/config && chown node:node /app/config
# Daily store phone export baseline + archives. Mount a volume at /app/data
# in prod so diffs survive container restarts.
RUN mkdir -p /app/data && chown node:node /app/data
# WebSocket port the on-prem SIW agent connects back to. Override at runtime
# via -e WS_PORT and -p host:container.
EXPOSE 8080
USER node
CMD ["node", "src/index.js"]