Files
PinchChat/Dockerfile
Nicolas Varrot 6fb2f83716 fix: add Docker HEALTHCHECK for container health monitoring
- Add HEALTHCHECK instruction to Dockerfile (wget localhost:80, 30s interval)
- Add healthcheck config to docker-compose.yml
- Enables Docker/orchestrator health monitoring and auto-restart on failure
2026-02-13 11:12:43 +00:00

17 lines
442 B
Docker

# Stage 1: Build
FROM node:22-alpine AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
# Stage 2: Serve
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -qO /dev/null http://localhost:80/ || exit 1
CMD ["nginx", "-g", "daemon off;"]