From 5d5553d481e24f7b6d7221a1f6e39bcdd9438476 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sun, 28 Apr 2024 13:47:17 +0200 Subject: [PATCH] Update to 2.1.4 + cleanup --- example/images/miniflux/Dockerfile | 2 +- example/miniflux.nomad.hcl | 45 +++++++++++++++++------------- miniflux.nomad.hcl | 22 ++++++--------- variables.yml | 4 +-- 4 files changed, 36 insertions(+), 37 deletions(-) diff --git a/example/images/miniflux/Dockerfile b/example/images/miniflux/Dockerfile index 3f2606c..9eb58b0 100644 --- a/example/images/miniflux/Dockerfile +++ b/example/images/miniflux/Dockerfile @@ -1,7 +1,7 @@ FROM danielberteaud/alpine:24.4-1 MAINTAINER Daniel Berteaud -ARG MINIFLUX_VERSION=2.1.2 +ARG MINIFLUX_VERSION=2.1.3 ENV LISTEN_ADDR=0.0.0.0:8085 \ RUN_MIGRATIONS=1 \ diff --git a/example/miniflux.nomad.hcl b/example/miniflux.nomad.hcl index e66c610..1c4eadf 100644 --- a/example/miniflux.nomad.hcl +++ b/example/miniflux.nomad.hcl @@ -5,20 +5,23 @@ job "miniflux" { region = "global" - - group "miniflux" { - count = 1 + count = 1 + shutdown_delay = "6s" + + + + ephemeral_disk { + # Use minimal ephemeral disk + size = 101 + } + network { mode = "bridge" } - ephemeral_disk { - size = 101 - } - service { name = "miniflux" port = 8085 @@ -70,8 +73,8 @@ job "miniflux" { type = "http" path = "/healthcheck" expose = true - interval = "10s" - timeout = "3s" + interval = "30s" + timeout = "5s" check_restart { limit = 20 @@ -128,9 +131,10 @@ job "miniflux" { driver = "docker" config { - image = "danielberteaud/miniflux:2.1.2-2" - pids_limit = 100 + image = "danielberteaud/miniflux:2.1.3-1" readonly_rootfs = true + + pids_limit = 100 } @@ -147,15 +151,6 @@ job "miniflux" { BASE_URL = "https://flux.example.org" } - template { - data = <<_EOT -DATABASE_URL=postgresql://{{ with secret "database/creds/miniflux" }}{{ .Data.username }}{{ end }}:{{ with secret "database/creds/miniflux" }}{{ urlquery .Data.password }}{{ end }}@127.0.0.1:5432/miniflux?sslmode=disable -_EOT - destination = "secrets/.db.env" - perms = 400 - env = true - } - # Use a template block instead of env {} so we can fetch values from vault @@ -170,6 +165,16 @@ _EOT } + template { + data = <<_EOT +DATABASE_URL=postgresql://{{ with secret "database/creds/miniflux" }}{{ .Data.username }}{{ end }}:{{ with secret "database/creds/miniflux" }}{{ urlquery .Data.password }}{{ end }}@127.0.0.1:5432/miniflux?sslmode=disable +_EOT + destination = "secrets/.db.env" + perms = 400 + env = true + } + + resources { cpu = 50 memory = 192 diff --git a/miniflux.nomad.hcl b/miniflux.nomad.hcl index 5e23c65..e091e67 100644 --- a/miniflux.nomad.hcl +++ b/miniflux.nomad.hcl @@ -1,12 +1,10 @@ job "[[ .instance ]]" { -[[- $c := merge .miniflux . ]] - -[[ template "common/job_start" $c ]] +[[ template "common/job_start" . ]] group "miniflux" { - - count = [[ .miniflux.count ]] +[[- $c := merge .miniflux . ]] +[[ template "common/group_start" $c ]] network { mode = "bridge" @@ -15,10 +13,6 @@ job "[[ .instance ]]" { [[- end ]] } - ephemeral_disk { - size = 101 - } - service { name = "[[ .instance ]][[ .consul.suffix ]]" port = 8085 @@ -30,8 +24,8 @@ job "[[ .instance ]]" { type = "http" path = "/healthcheck" expose = true - interval = "10s" - timeout = "3s" + interval = "[[ $c.consul.check.interval ]]" + timeout = "[[ $c.consul.check.timeout ]]" check_restart { limit = 20 @@ -52,9 +46,8 @@ job "[[ .instance ]]" { driver = "[[ $c.nomad.driver ]]" config { - image = "[[ .miniflux.image ]]" +[[ template "common/image" $c ]] pids_limit = 100 - readonly_rootfs = true } [[ template "common/vault.policies" $c ]] @@ -67,6 +60,8 @@ job "[[ .instance ]]" { [[- end ]] } +[[ template "common/file_env" $c ]] + template { data =<<_EOT DATABASE_URL=postgresql:// @@ -81,7 +76,6 @@ _EOT env = true } -[[ template "common/file_env" $c ]] [[ template "common/resources" $c ]] } } diff --git a/variables.yml b/variables.yml index ce17490..f302117 100644 --- a/variables.yml +++ b/variables.yml @@ -6,10 +6,10 @@ instance: miniflux miniflux: # Version of miniflux - version: 2.1.2 + version: 2.1.3 # Docker image to use - image: '[[ .docker.repo ]]miniflux:[[ .miniflux.version ]]-2' + image: '[[ .docker.repo ]]miniflux:[[ .miniflux.version ]]-1' # Number of instance to run count: 1