forked from alvaroaleman/docker-backuppc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (41 loc) · 1.86 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
FROM debian:buster
ENV DEBIAN_FRONTEND noninteractive
ENV TMP_CONFIG /backuppc_initial_config
ENV TMP_DATA /backuppc_initial_data
ENV PERSISTENT_CONFIG /etc/backuppc
ENV PERSISTENT_DATA /var/lib/backuppc
ENV STARTSCRIPT /usr/local/bin/dockerstart.sh
# vjrj: changed to false because it's very slow:
ENV RESET_PERMISSIONS false
ADD startscript.sh $STARTSCRIPT
RUN \
# Install packages \
apt-get update -y && \
echo 'backuppc backuppc/reconfigure-webserver multiselect apache2' | debconf-set-selections && \
apt-get install -y debconf-utils backuppc supervisor monitoring-plugins-common vim netcat ssh-tools && \
# Configure package config to a temporary folder to be able to restore it when no config is present
mkdir -p $TMP_CONFIG $TMP_DATA/.ssh && \
mv $PERSISTENT_CONFIG/* $TMP_CONFIG && \
mv $PERSISTENT_DATA/* $TMP_DATA && \
# Disable ssh host key checking per default
echo "host *" >> $TMP_DATA/.ssh/config && \
echo " StrictHostKeyChecking no" >> $TMP_DATA/.ssh/config && \
# Disable basic auth for package generated config
# sed -i 's/Auth.*//g' $TMP_CONFIG/apache.conf && \
#
# Allow from the outside
sed -i 's/Require local//g' $TMP_CONFIG/apache.conf && \
# Display Backuppc on / rather than /backuppc
sed -i 's/Alias \/backuppc/Alias \//' $TMP_CONFIG/apache.conf && \
# This is required to load images on /
sed -i "s/^\$Conf{CgiImageDirURL} =.*/\$Conf{CgiImageDirURL} = '\/image';/g" $TMP_CONFIG/config.pl && \
# Remove host 'localhost' from package generated config
sed -i 's/^localhost.*//g' $TMP_CONFIG/hosts && \
# Make startscript executable
chmod ugo+x $STARTSCRIPT
ADD supervisor.conf /etc/supervisor/conf.d/supervisord.conf
ADD check_backuppc /usr/lib/nagios/plugins/check_backuppc
EXPOSE 80
VOLUME $PERSISTENT_DATA
VOLUME $PERSISTENT_CONFIG
cmd $STARTSCRIPT