mirror of
https://github.com/idrainformatica/PecFlow.git
synced 2026-06-16 12:45:42 +02:00
Fase 2
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
# Dipendenze di sistema
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc \
|
||||
libpq-dev \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /worker
|
||||
|
||||
# Installa dipendenze Python
|
||||
COPY pyproject.toml .
|
||||
RUN pip install --no-cache-dir -e ".[dev]"
|
||||
|
||||
# Copia codice sorgente
|
||||
COPY . .
|
||||
|
||||
# Healthcheck: verifica che il processo worker sia vivo
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
|
||||
CMD python -c "import redis; r = redis.Redis.from_url('${REDIS_URL:-redis://redis:6379/0}'); r.ping()" || exit 1
|
||||
|
||||
# Entrypoint: avvia il worker arq
|
||||
CMD ["python", "-m", "app.main"]
|
||||
Reference in New Issue
Block a user