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>
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
@ -12,7 +12,7 @@ RUN set -euxo pipefail &&\
rm -f UniFi/bin/mongod &&\
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>
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"
group "unifi" {
shutdown_delay = "6s"
ephemeral_disk {
# Use minimal ephemeral disk
size = 101
}
network {
mode = "bridge"
port "stun" {
@ -18,6 +26,16 @@ job "unifi" {
name = "unifi"
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 {
sidecar_service {
}
@ -47,7 +65,7 @@ job "unifi" {
type = "http"
path = "/status"
expose = true
interval = "10s"
interval = "30s"
timeout = "5s"
check_restart {
limit = 12
@ -98,6 +116,17 @@ job "unifi" {
name = "unifi-mongo"
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 {
type = "script"
command = "sh"
@ -114,6 +143,7 @@ job "unifi" {
}
volume "mongo" {
source = "unifi-mongo"
type = "csi"
@ -123,6 +153,7 @@ job "unifi" {
volume "data" {
source = "unifi-data"
type = "csi"
@ -137,7 +168,7 @@ job "unifi" {
user = 1053
config {
image = "danielberteaud/wait-for:24.3-1"
image = "danielberteaud/wait-for:24.4-1"
readonly_rootfs = true
pids_limit = 20
}
@ -290,8 +321,6 @@ _EOF
env {
TMPDIR = "/local/tmp"
}
@ -390,7 +419,7 @@ _EOF
}
config {
image = "danielberteaud/mongo:5.0.24.3-1"
image = "danielberteaud/mongo:5.0.24.4-1"
command = "mongod"
readonly_rootfs = true
pids_limit = 200

View File

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