# Convivo sidecar — Sessionize sync (on-demand).
#
# A small Node HTTP service driven by the APPE Admin "Interfaces" menu. It
# fetches an event's Sessionize data (authenticated API) and writes it to
# Supabase via the service-role-only sync_sessionize_event RPC.
#
# It joins the shared Supabase network and reaches PostgREST at
# supabase_kong_Convivo:8000 (Kong's internal port). It is the first
# server-side holder of the service-role key (see docs/backend/sidecar.md).
#
# One runtime dependency (xlsx, for parsing the Sessionize .xlsx export).
FROM node:20-alpine

WORKDIR /app

COPY package.json package-lock.json ./
RUN npm ci --omit=dev
COPY src/ ./src/

ENV NODE_ENV=production
EXPOSE 3002

CMD ["node", "src/server.js"]
