ARG NODE_VERSION=22-alpine FROM node:${NODE_VERSION} WORKDIR /app # Install only production deps using the lockfile so builds are deterministic. COPY package.json package-lock.json* ./ RUN npm ci --omit=dev # Source. (public/ is served by express.static, so it must be in the image.) COPY index.js mailer.js push.js db.js agenda.js ./ COPY db ./db COPY public ./public EXPOSE 3002 # Apply the schema (idempotent) then start the server. Same pattern as LabWise. CMD ["sh", "-c", "node db/migrate.js && node index.js"]