Commit d5a8a6ec authored by Klaus Frank's avatar Klaus Frank

Initial release

parents
version: '3'
services:
mongo:
image: mongo
container_name: unifidb
restart: unless-stopped
volumes:
- db-data:/data/db
unifi:
build:
context: unifi
container_name: unifi
restart: unless-stopped
links:
- mongo
ports:
- 3478:3478/udp
# Inform url
- 8080:8080
# Web-If
- 8443:8443
- 8880:8880
- 8843:8843
# Speedtest from android and ios app
- 6789:6789
# Layer 2 broadcast discovery
- 10001:10001/udp
volumes:
- /etc/localtime:/etc/localtime:ro
- cert:/usr/lib/unifi/cert
- data:/usr/lib/unifi/data
- logs:/usr/lib/unifi/logs
environment:
# - DB_MONGO_URI=mongodb://mongo:27017/unifi
# - STATDB_MONGO_URI=mongodb://mongo:27017/unifi_stat
# - UNIFI_DB_NAME=unifi
- TZ=UTC
volumes:
db-data:
data:
logs:
cert:
FROM debian:testing-slim
ARG VERSION=5.9.29
ARG DATADIR=/usr/lib/unifi/data
ENV JVM_INIT_HEAP_SIZE=128M
ENV JVM_MAX_HEAP_SIZE=1024M
ENV PGID=999
ENV PUID=999
ENV DB_MONGO_URI=mongodb://mongo:27017/unifi
ENV STATDB_MONGO_URI=mongodb://mongo:27017/unifi_stat
ENV UNIFI_DB_NAME=unifi
WORKDIR /usr/lib/unifi
RUN \
set -x \
&& apt-get update -q \
&& apt-get upgrade -y \
&& apt-get dist-upgrade -y \
&& mkdir -p /usr/share/man/man1 \
&& apt-get -y install --no-install-recommends \
bash \
binutils \
curl \
libcap2 \
openjdk-8-jre-headless \
openssl \
prelink \
wget \
tzdata \
unzip \
jsvc
RUN \
addgroup --system --gid ${PGID} unifi \
&& adduser --system --uid ${PUID} --gid ${PGID} unifi
RUN \
curl -sSL https://dl.ubnt.com/unifi/${VERSION}/UniFi.unix.zip -o /tmp/UniFi.unix.${VERSION}.zip \
&& unzip -q /tmp/UniFi.unix.${VERSION}.zip -d /tmp \
&& mv /tmp/UniFi/* /usr/lib/unifi/ \
&& bash -c 'mkdir -p {data,logs,run,cert}' \
&& echo unifi.logStdout=true > ${DATADIR}/system.properties \
&& echo unifi.config.readEnv=true >> ${DATADIR}/system.properties \
&& echo db.mongo.local=false >> ${DATADIR}/system.properties \
&& echo db.mongo.uri=${DB_MONGO_URI} >> ${DATADIR}/system.properties \
&& echo statdb.mongo.uri=${STATDB_MONGO_URI} >> ${DATADIR}/system.properties \
&& echo unifi.db.name=${UNIFI_DB_NAME} >> ${DATADIR}/system.properties \
&& chown -R unifi:unifi /usr/lib/unifi \
&& rm -rf /tmp/* /var/tmp/*
# RUN keytool -genkey -keyalg RSA -alias unifi -keystore ${DATADIR}/keystore -storepass aircontrolenterprise -keypass aircontrolenterprise -validity 1825 -keysize 4096 -dname "cn=unfi"
USER unifi:unifi
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"]
CMD ["/usr/bin/java", "-Dunifi.datadir=${DATADIR} -Dunifi.logdir=${LOGDIR} -Dunifi.rundir=${RUNDIR} -Xms${JVM_INIT_HEAP_SIZE} -Xmx${JVM_MAX_HEAP_SIZE} -Djava.awt.headless=true -Dfile.encoding=UTF-8", "-jar", "/usr/lib/unifi/lib/ace.jar", "start"]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment