-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
56 lines (45 loc) · 2.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# This Dockerfile has been created based on the following work by Justin Ouellette:
# https://github.com/jstn/docker-unifi-video/blob/master/Dockerfile (0e8dbcc)
# Bionic Beaver
FROM phusion/baseimage:0.11
ENV DEBIAN_FRONTEND noninteractive
RUN curl -sS https://dl.ubnt.com/firmwares/ufv/v3.10.13/unifi-video.Ubuntu18.04_amd64.v3.10.13.deb > /tmp/unifi-video.deb
RUN curl -sS http://launchpadlibrarian.net/505954411/openjdk-8-jre-headless_8u275-b01-0ubuntu1~18.04_amd64.deb > /tmp/jre.deb
# Bring in the latest and greatest
RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold"
# Install unifi-video dependencies and the core package itself
RUN apt-get install -y mongodb-server jsvc sudo libx11-6 libxext6 libxi6 libxrender1 libxtst6
RUN dpkg -i /tmp/jre.deb && rm /tmp/jre.deb
RUN dpkg -i /tmp/unifi-video.deb && rm /tmp/unifi-video.deb
RUN apt-get update && apt-get -f install
RUN sed -i -e 's/^log/#log/' /etc/mongodb.conf
RUN printf "syslog = true" | tee -a /etc/mongodb.conf
RUN mkdir /etc/service/mongodb /etc/service/unifi-video
RUN printf "#!/bin/sh\nexec /sbin/setuser mongodb /usr/bin/mongod --config /etc/mongodb.conf" | tee /etc/service/mongodb/run
RUN printf "#!/bin/sh\nexec /usr/sbin/unifi-video --nodetach start" | tee /etc/service/unifi-video/run
RUN chmod 500 /etc/service/mongodb/run /etc/service/unifi-video/run
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Interfaces to outside
VOLUME ["/var/lib/mongodb", "/var/lib/unifi-video", "/var/log/unifi-video"]
EXPOSE 6666 7080 7442 7443 7445 7446 7447
CMD ["/sbin/my_init"]
# Make sure you have created the target directories:
#
# 1. ~/Applications/unifi-video/unifi-video
# 2. ~/Applications/unifi-video/unifi-video/logs
# 3. ~/Applications/unifi-video/mongodb
#
# Run container by:
# docker run -d --privileged \
# -v ~/Applications/unifi-video/mongodb:/var/lib/mongodb \
# -v ~/Applications/unifi-video/unifi-video:/var/lib/unifi-video \
# -p 6666:6666 \
# -p 7080:7080 \
# -p 7442:7442 \
# -p 7443:7443 \
# -p 7445:7445 \
# -p 7446:7446 \
# -p 7447:7447 \
# --name unifi-video \
# --restart=unless-stopped \
# exsilium/unifi-video:v3.10.13