el deploy es un poco complicado
All checks were successful
build-and-push / build (push) Successful in 27s
build-and-push / deploy (push) Successful in 14s

This commit is contained in:
2025-05-14 18:58:37 -06:00
parent a59521aafd
commit b4c1653d90
2 changed files with 57 additions and 16 deletions

View File

@@ -1,24 +1,20 @@
# base liviano con Node y cron
FROM node:24-slim
# instala cron y utilidades necesarias
# instalar cron
RUN apt-get update && \
apt-get install -y cron && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# dependencias
COPY package*.json ./
RUN npm ci --omit=dev # solo deps de producción
RUN npm ci --omit=dev
# código fuente
# copiar todo el código y scripts cron
COPY . .
# scripts de sistema: se lanzan por cron
COPY cron/ /etc/cron.d/
RUN chmod +x /etc/cron.d/* && \
crontab /etc/cron.d/*
# copiar scripts cron exactamente como vienen
RUN cp -r cron /etc/cron.d && \
find /etc/cron.d -type f -exec chmod +x {} \;
# arranca cron y luego Node
CMD sh -c "cron && node cron-worker.js"