-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.backup
More file actions
26 lines (26 loc) · 1.49 KB
/
Copy pathDockerfile.backup
File metadata and controls
26 lines (26 loc) · 1.49 KB
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
# Standalone image for the nightly backup job — see infra/docker-compose.split.yml's
# `backup` service and scripts/backup.sh for the full spec.
#
# Deliberately NOT the app's own Dockerfile: this job only needs
# pg_dump/pg_restore/psql (postgres:16-alpine already ships them) plus
# gnupg (encrypt-before-upload) and aws-cli (S3-compatible upload). Keeping
# it a separate image means a change here can never affect what ships in
# app/worker, and vice versa.
#
# NOTE: this is a real file, not a compose `dockerfile_inline`, on purpose —
# `dockerfile_inline` silently falls back to the classic builder's default
# `Dockerfile` in the build context when the buildx plugin is not installed
# (confirmed locally: no buildx here, and `docker compose build backup`
# built the main app image instead of this one, with no error). A file that
# always resolves correctly beats a feature that only works when a specific
# plugin happens to be present.
FROM postgres:16-alpine
RUN apk add --no-cache bash gnupg curl aws-cli
# send-alert.sh is copied alongside backup.sh, into the SAME directory,
# because backup.sh sources it by a path relative to its own location
# (`dirname "${BASH_SOURCE[0]}"`) — see the comment in backup.sh. Both
# must land together or backup.sh fails at source-time on container start.
COPY scripts/backup.sh /usr/local/bin/backup.sh
COPY scripts/send-alert.sh /usr/local/bin/send-alert.sh
RUN chmod +x /usr/local/bin/backup.sh /usr/local/bin/send-alert.sh
ENTRYPOINT ["/usr/local/bin/backup.sh"]