-
Notifications
You must be signed in to change notification settings - Fork 37
/
Dockerfile
67 lines (56 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
57
58
59
60
61
62
63
64
65
66
67
FROM ubuntu:20.04
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL \
org.opencontainers.image.vendor="The Goofball - goofball222@gmail.com" \
org.opencontainers.image.url="https://github.com/goofball222/unifi" \
org.opencontainers.image.title="UniFi Controller" \
org.opencontainers.image.description="UniFi Controller" \
org.opencontainers.image.version=${VERSION}-Ubuntu \
org.opencontainers.image.source="https://github.com/goofball222/unifi" \
org.opencontainers.image.revision=${VCS_REF} \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.licenses="Apache-2.0"
ENV \
BIND_PRIV=false \
DEBIAN_FRONTEND=noninteractive \
DEBUG=false \
JVM_EXTRA_OPTS= \
JVM_INIT_HEAP_SIZE= \
JVM_MAX_HEAP_SIZE=1024M \
PGID=999 \
PUID=999 \
RUN_CHOWN=true \
RUNAS_UID0=false
WORKDIR /usr/lib/unifi
COPY root /
RUN set -x \
&& groupadd -r unifi -g $PGID \
&& useradd --no-log-init -r -u $PUID -g $PGID unifi \
&& apt-get -y update \
&& apt-get -y install apt-utils \
&& apt-get -y --no-install-recommends install \
binutils curl dirmngr \
gosu libcap2 libcap2-bin \
procps tzdata \
&& apt-get -y --no-install-recommends install \
ca-certificates-java openjdk-17-jre-headless \
&& apt-get -y --no-install-recommends install \
mongodb-server-core \
&& rm -rf /usr/bin/mongos \
&& curl -sSL https://dl.ui.com/unifi/${VERSION}/unifi_sysvinit_all.deb -o /tmp/unifi-${VERSION}.deb \
&& apt-get -y purge \
dirmngr \
&& apt-get -y autoremove --purge \
&& apt-get -y clean autoclean \
&& dpkg --force-all -i /tmp/unifi-${VERSION}.deb \
&& rm -rf data logs run \
&& bash -c 'mkdir -p {data,logs,run,cert}' \
&& chown -R unifi:unifi /usr/lib/unifi \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/*
EXPOSE 3478/udp 6789/tcp 8080/tcp 8443/tcp 8843/tcp 8880/tcp 10001/udp
VOLUME ["/usr/lib/unifi/cert", "/usr/lib/unifi/data", "/usr/lib/unifi/logs"]
HEALTHCHECK --start-period=2m CMD /usr/local/bin/docker-healthcheck.sh
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["unifi"]