33 lines
1.0 KiB
Docker
33 lines
1.0 KiB
Docker
FROM python:3.12-slim-bookworm
|
|
|
|
# pg_dump must be >= server version (source is PG 17+)
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
curl \
|
|
gnupg \
|
|
tzdata \
|
|
&& curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \
|
|
| gpg --dearmor -o /usr/share/keyrings/postgresql.gpg \
|
|
&& echo "deb [signed-by=/usr/share/keyrings/postgresql.gpg] http://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" \
|
|
> /etc/apt/sources.list.d/pgdg.list \
|
|
&& apt-get update \
|
|
&& apt-get install -y --no-install-recommends postgresql-client-17 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt .
|
|
RUN python -m pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY sync.sh /usr/local/bin/sync.sh
|
|
COPY entrypoint.py /usr/local/bin/entrypoint.py
|
|
RUN chmod +x /usr/local/bin/sync.sh /usr/local/bin/entrypoint.py
|
|
|
|
ENV TZ=Europe/Brussels
|
|
ENV SOURCE_DB_URL=""
|
|
ENV DEST_DB_URL=""
|
|
ENV CRON=""
|
|
ENV ON_STARTUP=true
|
|
|
|
ENTRYPOINT ["/usr/local/bin/entrypoint.py"]
|