forked from kartoza/docker-pg-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (27 loc) · 1.3 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
##############################################################################
# Production Stage #
##############################################################################
ARG POSTGRES_MAJOR_VERSION=16
FROM postgres:$POSTGRES_MAJOR_VERSION-alpine AS postgres-backup-production
RUN apk update && apk add --no-cache python3 py3-pip vim gettext \
&& rm -rf /var/cache/apk/*
RUN pip3 install s3cmd python-magic --break-system-packages
RUN touch /var/log/cron.log
ENV \
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
ADD build_data /build_data
ADD scripts /backup-scripts
RUN chmod 0755 /backup-scripts/*.sh
WORKDIR /backup-scripts
ENTRYPOINT ["/bin/bash", "/backup-scripts/start.sh"]
CMD []
##############################################################################
# Testing Stage #
##############################################################################
FROM postgres-backup-production AS postgres-backup-test
COPY scenario_tests/utils/requirements.txt /lib/utils/requirements.txt
RUN set -eux \
&& apk update \
&& apk add --no-cache python3 py3-pip \
&& rm -rf /var/cache/apk/*
RUN pip3 install -r /lib/utils/requirements.txt --break-system-packages