Files
wallabicher/web/backend/Dockerfile
Omar Sánchez Pizarro 38d644da1f fix: update Dockerfile and enhance article deletion route
- Changed the COPY command in Dockerfile to reference workers.json directly.
- Added basic authentication middleware to the article deletion route for improved security.
2026-01-20 04:21:13 +01:00

33 lines
687 B
Docker

FROM node:18-alpine
# Instalar wget para healthcheck
RUN apk add --no-cache wget
WORKDIR /app
# Copiar archivos de dependencias
COPY package.json package-lock.json* ./
# Instalar dependencias
RUN npm ci --only=production
# Copiar código de la aplicación
COPY server.js .
COPY config/ ./config/
COPY middlewares/ ./middlewares/
COPY routes/ ./routes/
COPY services/ ./services/
COPY utils/ ./utils/
COPY workers.json ./workers.json
# Exponer puerto
EXPOSE 3001
# Healthcheck
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD wget --quiet --tries=1 --spider http://localhost:3001/api/health || exit 1
# Comando por defecto
CMD ["node", "server.js"]