worker mejorado
This commit is contained in:
@@ -64,8 +64,7 @@ jobs:
|
||||
# ──────────────── push loop ────────────────
|
||||
- name: Push images
|
||||
run: |
|
||||
for img in planilla \
|
||||
planilla-agent \
|
||||
for img in planilla-agent \
|
||||
planilla-api \
|
||||
planilla-mcp \
|
||||
planilla-ui \
|
||||
@@ -85,8 +84,7 @@ jobs:
|
||||
|
||||
- name: Pull latest images
|
||||
run: |
|
||||
for img in planilla \
|
||||
planilla-agent \
|
||||
for img in planilla-agent \
|
||||
planilla-api \
|
||||
planilla-mcp \
|
||||
planilla-ui \
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
# planilla/api/Dockerfile
|
||||
FROM node:18-alpine
|
||||
# base liviano con Node y cron
|
||||
FROM node:20-alpine
|
||||
|
||||
# instala cronie
|
||||
RUN apk add --no-cache cronie
|
||||
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
RUN npm ci --omit=dev # solo deps prod
|
||||
COPY . .
|
||||
CMD ["`npm", "start"]
|
||||
|
||||
# scripts de sistema: se lanzan por cronie
|
||||
COPY cron/ /etc/periodic/
|
||||
RUN chmod +x /etc/periodic/*/*
|
||||
|
||||
# arranca cron (en background) y luego Node
|
||||
CMD sh -c "crond -l 2 & node cron-worker.js"
|
||||
|
||||
2
worker/cron/15min/hello.sh
Normal file
2
worker/cron/15min/hello.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
echo "[hello] $(date) — hello world"
|
||||
Reference in New Issue
Block a user