# Dockerfile for the Node.js checkpoint service FROM node:18-alpine # Set working directory WORKDIR /app # Copy package files, config script COPY package.json package-lock.json esbuild.config.js ./ # Copy application source before build so esbuild can locate entry files COPY . . # Install all dependencies, create dist folder, build with esbuild, then remove devDeps RUN npm ci && mkdir -p dist && npm run build && npm prune --production # Expose the application port EXPOSE 3000 # Set NODE_ENV to production ENV NODE_ENV=production # Run the application CMD ["npm", "run", "daemon"]