This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
80 lines (72 loc) · 3.25 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# =============================================================================
# Dockerfile
# Unifi Dream Machine Backup to FTP
# https://github.com/aessing/udm-backup-ftp
# -----------------------------------------------------------------------------
# Developer.......: Andre Essing (https://www.andre-essing.de/)
# (https://github.com/aessing)
# (https://twitter.com/aessing)
# (https://www.linkedin.com/in/aessing/)
# -----------------------------------------------------------------------------
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
# =============================================================================
###############################################################################
#
# Get the base Linux image
#
FROM arm64v8/alpine:latest
###############################################################################
#
# Set some information
#
LABEL tag="aessing/udm-backup-ftp" \
description="A Docker container which copies automatic backups from the Unifi Dream Machine to a FTP server" \
disclaimer="THE CONTENT OF THIS REPOSITORY IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE CONTENT OF THIS REPOSITORY OR THE USE OR OTHER DEALINGS BY CONTENT OF THIS REPOSITORY." \
vendor="Andre Essing" \
github-repo="https://github.com/aessing/udm-backup-ftp"
###############################################################################
#
# Set some parameters
#
ENV FTP_SERVER=''
ENV FTP_PATH=''
ENV FTP_USER=''
ENV FTP_PASSWORD=''
ENV UNIFI_BACKUPS='/backups'
ENV UNIFI_NETWORK_BACKUPS='/backups/unifi'
ENV UNIFI_PROTECT_BACKUPS='/backups/protect'
VOLUME ${UNIFI_NETWORK_BACKUPS}
VOLUME ${UNIFI_PROTECT_BACKUPS}
###############################################################################
#
# Update Linux and install necessary packages
#
RUN apk add --no-cache ca-certificates \
lftp
###############################################################################
#
# Copy files
#
COPY startup.sh /startup.sh
RUN chmod a+x /startup.sh
###############################################################################
#
# Create and run in non-root context
#
RUN addgroup -g 902 -S unifi && \
addgroup -g 903 -S unifi-protect && \
addgroup -g 1001 -S backupuser && \
adduser -G backupuser -S -u 1001 backupuser && \
addgroup backupuser unifi && \
addgroup backupuser unifi-protect
USER backupuser
###############################################################################
#
# Start FTP copy process
#
WORKDIR /
ENTRYPOINT [ "./startup.sh" ]
###############################################################################
#EOF