forked from jameslikeslinux/docker-unifi-protect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (28 loc) · 1.12 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
#
# UniFi Protect Dockerfile
# Copyright (C) 2019 James T. Lee
#
FROM ubuntu:18.04
# Install build tools
RUN apt-get update \
&& apt-get install -y wget
# Install unifi-protect and its dependencies
RUN wget --progress=dot:mega https://apt.ubnt.com/pool/beta/u/unifi-protect/unifi-protect.jessie~stretch~xenial~bionic_amd64.v1.12.5.deb -O unifi-protect.deb \
&& apt install -y ./unifi-protect.deb \
&& rm -f unifi-protect.deb
# Cleanup
RUN apt-get remove --purge --auto-remove -y wget \
&& rm -rf /var/cache/apt/lists/*
# Initialize based on /usr/share/unifi-protect/app/hooks/pre-start
RUN pg_ctlcluster 10 main start \
&& su postgres -c 'createuser unifi-protect -d' \
&& pg_ctlcluster 10 main stop \
&& ln -s /srv/unifi-protect/logs /var/log/unifi-protect \
&& mkdir /srv/unifi-protect /srv/unifi-protect/backups /var/run/unifi-protect \
&& chown unifi-protect:unifi-protect /srv/unifi-protect /srv/unifi-protect/backups /var/run/unifi-protect \
&& ln -s /tmp /srv/unifi-protect/temp
# Configure
COPY config.json /etc/unifi-protect/config.json
# Supply simple script to run postgres and unifi-protect
COPY init /init
CMD ["/init"]