All checks were successful
Build and Push Docker Images / build (push) Successful in 20s
36 lines
1.2 KiB
Docker
36 lines
1.2 KiB
Docker
# =============================================================================
|
|
# Prefect Worker - PostgreSQL Backup
|
|
#
|
|
# Image Docker pour un worker Prefect dédié aux sauvegardes PostgreSQL
|
|
# Inclut les outils nécessaires pour dump PG et upload vers S3 (Garage)
|
|
# =============================================================================
|
|
|
|
FROM prefecthq/prefect:3-python3.12
|
|
|
|
LABEL maintainer="Damien Arnodo"
|
|
LABEL org.opencontainers.image.title="Prefect Worker - PostgreSQL Backup"
|
|
LABEL org.opencontainers.image.description="Prefect worker with PostgreSQL and S3 tools for database backups"
|
|
|
|
# Installation des outils système
|
|
# - postgresql-client : pg_dump, pg_restore, psql
|
|
# - git : nécessaire pour cloner les repositories contenant le code des flows
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
postgresql-client \
|
|
git \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Installation des dépendances Python pour S3 et PostgreSQL
|
|
RUN pip install --no-cache-dir \
|
|
boto3 \
|
|
psycopg2-binary \
|
|
prefect-aws
|
|
|
|
# Création d'un utilisateur non-root
|
|
RUN useradd -m -u 1000 prefect
|
|
USER prefect
|
|
|
|
WORKDIR /app
|
|
|
|
# Le worker sera démarré via la commande dans docker-compose
|
|
# CMD ["prefect", "worker", "start", "--pool", "my-pool"]
|