# ============================================================================= # GoHorse Jobs Seeder API - Production Dockerfile (Node.js only) # ============================================================================= FROM node:20-alpine WORKDIR /app # Install wget for healthcheck RUN apk add --no-cache wget # Install Node.js dependencies for seed scripts COPY package*.json ./ RUN npm ci --only=production && npm cache clean --force # Copy seeders and SQL assets COPY src/ ./src/ COPY sql/ ./sql/ # Security: Run as non-root RUN addgroup -g 1001 -S nodejs && \ adduser -u 1001 -S seeder -G nodejs && \ chown -R seeder:nodejs /app USER seeder # Environment ENV NODE_ENV=production \ PORT=8080 EXPOSE 8080 # Health check with longer timeout for database operations HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 \ CMD wget -qO- http://localhost:8080/health || exit 1 CMD ["node", "src/server.js"]