Features - Payment reminders via Resend (candidates, send, history, test email) - Bulk import of the customer list from Excel/CSV in the dashboard - Dashboard i18n (en/nl) with language selector Security - Enforce venue isolation on all /venues/:venueId routes - Require admin for planned-tab changes and pairing codes - Rate-limit login and device registration; opt-in TRUST_PROXY - Require JWT_SECRET in production; stop leaking internal errors - Escape customer names in reminder emails Sync and commands - Remove tabs the terminal no longer reports; validate nested sync payload - Return all pending commands on every sync (fixes missed-command race) - First command ack wins; atomic registration code claim - Reject commands for revoked devices, stale versions or duplicates - Remind only unpaid balances, with a 7-day cooldown Dashboard - Share a single token refresh across concurrent 401s (random logouts) - Keep the session alive for the refresh token lifetime Deployment - Replace `db push --accept-data-loss` with migrations (baselines legacy DBs) - Set NODE_ENV=production; pass Resend and TRUST_PROXY env in prod compose
61 lines
1.9 KiB
Docker
61 lines
1.9 KiB
Docker
FROM node:20-alpine AS builder
|
|
WORKDIR /app
|
|
RUN npm install -g pnpm
|
|
RUN apk add --no-cache openssl
|
|
|
|
ARG NEXT_PUBLIC_API_URL
|
|
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:3001/api/v1}
|
|
|
|
COPY pnpm-workspace.yaml package.json tsconfig.base.json pnpm-lock.yaml ./
|
|
COPY packages/shared/package.json packages/shared/
|
|
COPY apps/api/package.json apps/api/
|
|
COPY apps/dashboard/package.json apps/dashboard/
|
|
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
COPY packages/shared packages/shared
|
|
COPY apps/api apps/api
|
|
COPY apps/dashboard apps/dashboard
|
|
|
|
RUN pnpm --filter @kooltab/shared run build
|
|
RUN cd apps/api && npx prisma generate
|
|
RUN pnpm --filter @kooltab/api run build
|
|
RUN pnpm --filter @kooltab/dashboard run build
|
|
|
|
# ---- Production API image ----
|
|
FROM node:20-alpine AS api
|
|
RUN npm install -g pnpm
|
|
RUN apk add --no-cache openssl
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/apps/api/dist ./dist
|
|
COPY --from=builder /app/apps/api/prisma ./prisma
|
|
COPY --from=builder /app/apps/api/package.json ./
|
|
COPY --from=builder /app/pnpm-lock.yaml ./
|
|
COPY --from=builder /app/pnpm-workspace.yaml ./
|
|
COPY --from=builder /app/packages/shared/package.json ./packages/shared/
|
|
COPY --from=builder /app/packages/shared/dist ./packages/shared/dist/
|
|
RUN pnpm install --prod
|
|
|
|
ENV NODE_ENV=production
|
|
EXPOSE 3001
|
|
CMD ["sh", "-c", "node prisma/deploy.js && node dist/main.js"]
|
|
|
|
# ---- Production Dashboard image ----
|
|
FROM node:20-alpine AS dashboard
|
|
RUN npm install -g pnpm
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/apps/dashboard/.next ./.next
|
|
COPY --from=builder /app/apps/dashboard/package.json ./
|
|
COPY --from=builder /app/apps/dashboard/next.config.js ./
|
|
RUN mkdir -p public
|
|
|
|
COPY --from=builder /app/pnpm-lock.yaml ./
|
|
COPY --from=builder /app/pnpm-workspace.yaml ./
|
|
COPY --from=builder /app/packages/shared/package.json ./packages/shared/
|
|
COPY --from=builder /app/packages/shared/dist ./packages/shared/dist/
|
|
RUN pnpm install --prod
|
|
|
|
EXPOSE 3000
|
|
CMD ["node", "node_modules/next/dist/bin/next", "start"] |