-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile.pkg
More file actions
60 lines (52 loc) · 2.31 KB
/
Containerfile.pkg
File metadata and controls
60 lines (52 loc) · 2.31 KB
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
# --------------------------------------------------------------------------
# THIS FILE IS AUTOGENERATED - DO NOT EDIT MANUALLY
#
# Source: Containerfile.pkg.j2
# --------------------------------------------------------------------------
ARG BASE_VERSION=15
FROM ghcr.io/daemonless/base:${BASE_VERSION}
ARG FREEBSD_ARCH=amd64
ARG PKG_NAME=unifi10
LABEL org.opencontainers.image.title="UniFi Network" \
org.opencontainers.image.description="Ubiquiti UniFi Network Application for managing UniFi access points, switches, and gateways." \
org.opencontainers.image.source="https://github.com/daemonless/unifi" \
org.opencontainers.image.url="https://ui.com/" \
org.opencontainers.image.documentation="https://help.ui.com/" \
org.opencontainers.image.licenses="Proprietary" \
org.opencontainers.image.vendor="daemonless" \
org.opencontainers.image.authors="daemonless" \
io.daemonless.port="8443" \
io.daemonless.arch="${FREEBSD_ARCH}" \
io.daemonless.pkg-name="${PKG_NAME}" \
org.freebsd.jail.allow.mlock="required"
# Install from FreeBSD packages
RUN pkg update && \
pkg install -y ${PKG_NAME} && \
UNIFI_VERSION=$(pkg info ${PKG_NAME} | sed -n 's/.*Version.*: *//p') && \
mkdir -p /app && echo "$UNIFI_VERSION" > /app/version && \
pkg clean -ay && \
rm -rf /var/cache/pkg/* /var/db/pkg/repos/*
# Create config directory and symlink data dir
# UniFi installs to /usr/local/share/java/unifi
RUN mkdir -p /config /var/run/unifi && \
rm -rf /usr/local/share/java/unifi/data && \
ln -sf /config /usr/local/share/java/unifi/data && \
chown -R bsd:bsd /config /var/run/unifi /usr/local/share/java/unifi
# Copy service definition and init scripts
COPY root/ /
# Make scripts executable
RUN chmod +x /etc/services.d/*/run /etc/cont-init.d/* 2>/dev/null || true
# Set up s6 service links for unifi and mongodb
RUN mkdir -p /run/s6/services/unifi /run/s6/services/mongodb && \
ln -sf /etc/services.d/unifi/run /run/s6/services/unifi/run && \
ln -sf /etc/services.d/mongodb/run /run/s6/services/mongodb/run
# UniFi ports:
# 8443 - Web UI (HTTPS)
# 8080 - Device inform
# 8843 - Guest portal HTTPS
# 8880 - Guest portal HTTP
# 6789 - Mobile throughput test
# 3478/udp - STUN
# 10001/udp - Device discovery
EXPOSE 8443 8080 8843 8880 6789 3478 10001
VOLUME /config