-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (28 loc) · 1.6 KB
/
Dockerfile
File metadata and controls
32 lines (28 loc) · 1.6 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
27
28
29
30
31
32
FROM python:3.13.7-slim-trixie@sha256:5f55cdf0c5d9dc1a415637a5ccc4a9e18663ad203673173b8cda8f8dcacef689
ENV PYTHONUNBUFFERED=1
RUN --mount=type=cache,id=apt-cache,target=/var/cache/apt apt-get update \
# dependencies for s3fs (latest version with cache management)
&& apt-get install -y s3fs=1.95-1 glib-networking curl gnupg gzip zip unzip \
# build dependencies for borgbackup (removed after pip install)
&& apt-get install -y python3-dev libacl1-dev libssl-dev liblz4-dev libzstd-dev libxxhash-dev build-essential pkg-config libfuse-dev fuse \
# dependencies for USB storage backend (blkid, ntfs support)
&& apt-get install -y util-linux ntfs-3g e2fsprogs xfsprogs btrfs-progs dosfstools \
&& rm -rf /var/lib/apt/lists/*
# Requirements are installed here to ensure they will be cached.
RUN python -m pip install --upgrade pip
RUN --mount=type=cache,id=pip-cache,target=/root/.cache/pip pip install borgbackup==1.4.1 llfuse
# Remove build-only dependencies to reduce image size
RUN apt-get purge -y --auto-remove python3-dev libacl1-dev libssl-dev liblz4-dev libzstd-dev libxxhash-dev build-essential pkg-config libfuse-dev \
&& rm -rf /var/lib/apt/lists/*
COPY ./entrypoint /entrypoint
RUN chmod +x /entrypoint
COPY ./start /start
RUN chmod +x /start
# Copy and setup backup script
COPY ./backup.sh /usr/sbin/backup.sh
RUN chmod +x /usr/sbin/backup.sh \
&& mkdir -p /var/log/borgbackup
# Health check: verify backup mount is accessible (only meaningful during backup runs)
HEALTHCHECK --interval=60s --timeout=5s --start-period=30s --retries=3 \
CMD test -d /mnt/backup || exit 1
ENTRYPOINT ["/entrypoint"]