- Bump Dockerfile base image from node:18-alpine to node:22-alpine to fix build failure (better-sqlite3@12.8.0 requires Node 20+) - Add post-transaction verification logging in POST /api/votes/live to detect live_votes insertion failures in production - Add direct DB assertion to regression test for live_votes population - Add end-to-end integration tests covering the full vote flow: POST vote -> GET /api/sessions/:id/votes -> GET /api/votes -> direct DB Made-with: Cursor
38 lines
668 B
Docker
38 lines
668 B
Docker
FROM node:22-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Install Chromium, fonts, and dependencies for Puppeteer
|
|
RUN apk add --no-cache \
|
|
wget \
|
|
chromium \
|
|
nss \
|
|
freetype \
|
|
harfbuzz \
|
|
ca-certificates \
|
|
ttf-freefont \
|
|
font-noto-emoji
|
|
|
|
# Tell Puppeteer to use the installed Chromium
|
|
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm install --omit=dev
|
|
|
|
# Copy application files
|
|
COPY . .
|
|
|
|
# Create data directory for SQLite database
|
|
RUN mkdir -p /app/data
|
|
|
|
# Expose port
|
|
EXPOSE 5000
|
|
|
|
# Start the application
|
|
CMD ["node", "server.js"]
|
|
|