FROM node:20-alpine RUN apk add --no-cache libc6-compat WORKDIR /app COPY package.json package-lock.json ./ # Use npm install instead of npm ci to handle lock file discrepancies automatically # This prevents the "Missing ... from lock file" error RUN npm install --legacy-peer-deps COPY . . # Environment variables for build time (if needed by Next.js build) # Note: Secrets are usually injected by the platform, but we can set defaults or placeholders # ENV DATABASE_URL=... RUN npm run build # Start the application with the drizzle push command included in package.json start script CMD ["npm", "start"]