-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
40 lines (29 loc) · 1.46 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
FROM registry.fedoraproject.org/fedora:latest
MAINTAINER "Joe Doss <[email protected]>"
ARG UNIFI_VERSION=5.11.31-ad89aa3621
ARG UNIFI_SHA256=0d6a68f71e5c83f33ee89dc95279487ad505c0119b5c7166bbf7431b1a0b7fe9
ENV UNIFI_VERSION=${UNIFI_VERSION}
ENV UNIFI_SHA256=${UNIFI_SHA256}
ARG UNIFI_UID=271
ENV UNIFI_UID=${UNIFI_UID}
ARG JVM_MAX_HEAP_SIZE=1024m
ENV JVM_MAX_HEAP_SIZE=${JVM_MAX_HEAP_SIZE}
RUN dnf -y update && \
dnf install -y java-1.8.0-openjdk wget unzip && \
dnf install -y https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.4/x86_64/RPMS/mongodb-org-server-3.4.9-1.el7.x86_64.rpm && \
dnf clean all -y
RUN adduser -r -s /sbin/nologin -d /opt/unifi -u 271 -U unifi && \
curl -LS https://dl.ubnt.com/unifi/${UNIFI_VERSION}/UniFi.unix.zip | \
{ UNIFI_FILE_DOWNLOAD="$(mktemp --suffix=-unifi-"${UNIFI_VERSION}")"; \
trap "rm -f '${UNIFI_FILE_DOWNLOAD}'" INT TERM EXIT; cat >| "${UNIFI_FILE_DOWNLOAD}"; \
sha256sum --quiet -c <<<"${UNIFI_SHA256} ${UNIFI_FILE_DOWNLOAD}" \
|| exit 1; unzip "${UNIFI_FILE_DOWNLOAD}" -d /opt; } && \
mv /opt/UniFi /opt/unifi && \
mkdir /opt/unifi/data && mkdir /opt/unifi/logs
COPY unifi /opt/unifi/unifi
RUN chown -R ${UNIFI_UID}:${UNIFI_UID} /opt/unifi && chmod +x /opt/unifi/unifi
USER ${UNIFI_UID}
EXPOSE 3478/udp 8080/tcp 8443/tcp 8843/tcp 8880/tcp 3478/udp 6789/tcp 10001/udp
VOLUME ["/opt/unifi/data", "/opt/unifi/logs", "/opt/unifi/run"]
WORKDIR /opt/unifi
CMD ["/opt/unifi/unifi"]