Small cleanup

This commit is contained in:
Daniel Berteaud 2024-04-26 13:36:04 +02:00
parent 0455f7cb6a
commit b73499c5ee
4 changed files with 47 additions and 15 deletions

View File

@ -1,4 +1,4 @@
FROM danielberteaud/alpine:24.3-1 FROM danielberteaud/alpine:24.4-1
MAINTAINER Daniel Berteaud <dbd@ehtrace.com> MAINTAINER Daniel Berteaud <dbd@ehtrace.com>
ENV UBNT_UPDATE_API="https://fw-update.ubnt.com/api/firmware-latest?filter=eq~~product~~unifi-firmware&filter=eq~~channel~~release" \ ENV UBNT_UPDATE_API="https://fw-update.ubnt.com/api/firmware-latest?filter=eq~~product~~unifi-firmware&filter=eq~~channel~~release" \

View File

@ -1,4 +1,4 @@
FROM danielberteaud/java:17.24.3-5 AS builder FROM danielberteaud/java:17.24.4-1 AS builder
ARG UNIFI_VERSION=8.1.113 ARG UNIFI_VERSION=8.1.113
@ -12,7 +12,7 @@ RUN set -euxo pipefail &&\
rm -f UniFi/bin/mongod &&\ rm -f UniFi/bin/mongod &&\
chown -R root:root UniFi chown -R root:root UniFi
FROM danielberteaud/java:17.24.3-5 FROM danielberteaud/java:17.24.4-1
MAINTAINER Daniel Berteaud <dbd@ehtrace.com> MAINTAINER Daniel Berteaud <dbd@ehtrace.com>
ENV JAVA_OPTS="-Djava.awt.headless=true -Dlogback.configurationFile=/opt/unifi/logback.xml --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED" \ ENV JAVA_OPTS="-Djava.awt.headless=true -Dlogback.configurationFile=/opt/unifi/logback.xml --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED" \

View File

@ -3,10 +3,18 @@ job "unifi" {
region = "global" region = "global"
group "unifi" { group "unifi" {
shutdown_delay = "6s"
ephemeral_disk {
# Use minimal ephemeral disk
size = 101
}
network { network {
mode = "bridge" mode = "bridge"
port "stun" { port "stun" {
@ -18,6 +26,16 @@ job "unifi" {
name = "unifi" name = "unifi"
port = 8888 port = 8888
meta {
alloc = "${NOMAD_ALLOC_INDEX}"
datacenter = "${NOMAD_DC}"
group = "${NOMAD_GROUP_NAME}"
job = "${NOMAD_JOB_NAME}"
namespace = "${NOMAD_NAMESPACE}"
node = "${node.unique.name}"
region = "${NOMAD_REGION}"
}
connect { connect {
sidecar_service { sidecar_service {
} }
@ -47,7 +65,7 @@ job "unifi" {
type = "http" type = "http"
path = "/status" path = "/status"
expose = true expose = true
interval = "10s" interval = "30s"
timeout = "5s" timeout = "5s"
check_restart { check_restart {
limit = 12 limit = 12
@ -98,6 +116,17 @@ job "unifi" {
name = "unifi-mongo" name = "unifi-mongo"
port = 27017 port = 27017
meta {
alloc = "${NOMAD_ALLOC_INDEX}"
datacenter = "${NOMAD_DC}"
group = "${NOMAD_GROUP_NAME}"
job = "${NOMAD_JOB_NAME}"
namespace = "${NOMAD_NAMESPACE}"
node = "${node.unique.name}"
region = "${NOMAD_REGION}"
}
check { check {
type = "script" type = "script"
command = "sh" command = "sh"
@ -114,6 +143,7 @@ job "unifi" {
} }
volume "mongo" { volume "mongo" {
source = "unifi-mongo" source = "unifi-mongo"
type = "csi" type = "csi"
@ -123,6 +153,7 @@ job "unifi" {
volume "data" { volume "data" {
source = "unifi-data" source = "unifi-data"
type = "csi" type = "csi"
@ -137,7 +168,7 @@ job "unifi" {
user = 1053 user = 1053
config { config {
image = "danielberteaud/wait-for:24.3-1" image = "danielberteaud/wait-for:24.4-1"
readonly_rootfs = true readonly_rootfs = true
pids_limit = 20 pids_limit = 20
} }
@ -290,8 +321,6 @@ _EOF
env { env {
TMPDIR = "/local/tmp" TMPDIR = "/local/tmp"
} }
@ -390,7 +419,7 @@ _EOF
} }
config { config {
image = "danielberteaud/mongo:5.0.24.3-1" image = "danielberteaud/mongo:5.0.24.4-1"
command = "mongod" command = "mongod"
readonly_rootfs = true readonly_rootfs = true
pids_limit = 200 pids_limit = 200

View File

@ -5,6 +5,7 @@ job "[[ .instance ]]" {
group "unifi" { group "unifi" {
[[- $c := merge .unifi.controller .unifi . ]] [[- $c := merge .unifi.controller .unifi . ]]
[[ template "common/group_start" $c ]]
network { network {
mode = "bridge" mode = "bridge"
@ -17,14 +18,15 @@ job "[[ .instance ]]" {
name = "[[ .instance ]][[ .consul.suffix ]]" name = "[[ .instance ]][[ .consul.suffix ]]"
port = 8888 port = 8888
[[ template "common/service_meta" $c ]]
[[ template "common/connect" $c ]] [[ template "common/connect" $c ]]
check { check {
type = "http" type = "http"
path = "/status" path = "/status"
expose = true expose = true
interval = "10s" interval = "[[ $c.consul.check.interval ]]"
timeout = "5s" timeout = "[[ $c.consul.check.timeout ]]"
check_restart { check_restart {
limit = 12 limit = 12
grace = "2m" grace = "2m"
@ -52,12 +54,14 @@ job "[[ .instance ]]" {
name = "[[ .instance ]]-mongo[[ .consul.suffix ]]" name = "[[ .instance ]]-mongo[[ .consul.suffix ]]"
port = 27017 port = 27017
[[ template "common/service_meta" $c ]]
check { check {
type = "script" type = "script"
command = "sh" command = "sh"
args = ["-c", "mongo --quiet --eval 'db.runCommand(\"ping\").ok'"] args = ["-c", "mongo --quiet --eval 'db.runCommand(\"ping\").ok'"]
interval = "30s" interval = "[[ $c.consul.check.interval ]]"
timeout = "5s" timeout = "[[ $c.consul.check.timeout ]]"
task = "mongo" task = "mongo"
check_restart { check_restart {
@ -125,7 +129,6 @@ _EOF
[[ template "common/vault.policies" $c ]] [[ template "common/vault.policies" $c ]]
env { env {
[[ template "common/proxy_env" . ]]
TMPDIR = "/local/tmp" TMPDIR = "/local/tmp"
} }