# Minimal compliant Dockerfile for a Node app deployed to this Coolify instance. # # Hard rules followed (see docs/AGENTS-coolify-apps.md): # - No published host ports 80/443 (Traefik routes them). # - Real listening port is set via ports_exposes in Coolify (here 8080). # - Healthcheck endpoint must NOT depend on the DB being reachable at boot. # # Replace the build/run commands with the ones that match your framework. FROM node:20-alpine AS build WORKDIR /app COPY package*.json ./ RUN npm ci COPY . . RUN npm run build FROM node:20-alpine AS run WORKDIR /app ENV NODE_ENV=production ENV PORT=8080 COPY --from=build /app /app # Cheap endpoint; implement /health in your app to return 200 without DB. HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=20s \ CMD wget -qO- http://localhost:8080/health || exit 1 EXPOSE 8080 CMD ["npm", "start"]