Replace caretakerd with minit
This commit is contained in:
parent
cc4a1d0608
commit
7feb6c5513
|
@ -1,8 +1,7 @@
|
|||
FROM danielberteaud/alma:9.24.1-3
|
||||
FROM danielberteaud/alma:9.24.1-5
|
||||
MAINTAINER Daniel Berteaud <dbd@ehtrace.com>
|
||||
|
||||
ARG LLNG_VERSION=2.18.1 \
|
||||
CARETAKERD_VERSION=1.0.8
|
||||
ARG LLNG_VERSION=2.18.1
|
||||
|
||||
ENV PATH=/usr/libexec/lemonldap-ng/bin:${PATH} \
|
||||
LLNG_LISTEN=unix:/tmp/llng.sock \
|
||||
|
@ -45,13 +44,10 @@ RUN set -eux &&\
|
|||
&&\
|
||||
# dnf is an alias using --nodocs, so install doc manually \
|
||||
microdnf -y install lemonldap-ng-doc-${LLNG_VERSION} &&\
|
||||
curl -sSL https://github.com/echocat/caretakerd/releases/download/v${CARETAKERD_VERSION}/caretakerd-linux-amd64.tar.gz | \
|
||||
tar xvz --exclude caretakerd.html -C /usr/local/bin &&\
|
||||
chmod +x /usr/local/bin/caretakerd &&\
|
||||
dnf -y clean all &&\
|
||||
rm -rf /var/cache/yum/* /var/log/yum/* /var/lib/dnf/history*
|
||||
|
||||
COPY root/ /
|
||||
|
||||
USER apache
|
||||
CMD ["caretakerd", "run"]
|
||||
CMD ["minit"]
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
services:
|
||||
lemonldap:
|
||||
type: master
|
||||
command: ["lemonldap-ng"]
|
||||
nginx:
|
||||
command: ["nginx", "-c", "${LLNG_NGINX_CONF}"]
|
||||
local_cache:
|
||||
command: ["/usr/libexec/lemonldap-ng/bin/purgeLocalCache"]
|
||||
cronExpression: '1 * * * *'
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
kind: daemon
|
||||
name: lemonldap
|
||||
command: ["lemonldap-ng"]
|
||||
|
||||
---
|
||||
kind: daemon
|
||||
name: nginx
|
||||
command: ["nginx", "-c", "${LLNG_NGINX_CONF}"]
|
||||
|
||||
---
|
||||
kind: cron
|
||||
name: local_cache
|
||||
command: ["/usr/libexec/lemonldap-ng/bin/purgeLocalCache"]
|
||||
cron: '1 * * * *'
|
|
@ -82,7 +82,7 @@ job "lemonldap-ng" {
|
|||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "danielberteaud/lemonldap-ng:2.18.1-6"
|
||||
image = "danielberteaud/lemonldap-ng:2.18.1-7"
|
||||
readonly_rootfs = true
|
||||
pids_limit = 200
|
||||
volumes = [
|
||||
|
@ -120,7 +120,7 @@ job "lemonldap-ng" {
|
|||
LLNG_MANAGER_VHOST = "manager.example.org"
|
||||
LLNG_PORTAL_VHOST = "sso.example.org"
|
||||
LLNG_CUSTOM_ASSETS_DIR = "/local/assets"
|
||||
CTD_CONFIG = "/local/caretakerd.yaml"
|
||||
MINIT_UNIT_DIR = "/local/minit.d"
|
||||
|
||||
|
||||
}
|
||||
|
@ -425,30 +425,36 @@ _EOT
|
|||
destination = "local/lmConf-1.json"
|
||||
}
|
||||
|
||||
# caretakerd is the init system used to run LL::NG, nginx and cron tasks
|
||||
# Configure minit to start uwsgi, nginx, cron tasks
|
||||
template {
|
||||
data = <<_EOT
|
||||
services:
|
||||
lemonldap:
|
||||
type: master
|
||||
command: ["lemonldap-ng"]
|
||||
local_cache:
|
||||
command: ["/usr/libexec/lemonldap-ng/bin/purgeLocalCache"]
|
||||
cronExpression: "@every 1h"
|
||||
logger:
|
||||
level: debug
|
||||
nginx:
|
||||
command: ["nginx", "-c", "${LLNG_NGINX_CONF}"]
|
||||
---
|
||||
kind: daemon
|
||||
name: lemonldap
|
||||
command: ["lemonldap-ng"]
|
||||
|
||||
---
|
||||
kind: daemon
|
||||
name: nginx
|
||||
command: ["nginx", "-c", "${LLNG_NGINX_CONF}"]
|
||||
|
||||
---
|
||||
kind: cron
|
||||
name: local_cache
|
||||
command: ["/usr/libexec/lemonldap-ng/bin/purgeLocalCache"]
|
||||
cron: "@every 1h"
|
||||
|
||||
{{- if eq (env "NOMAD_ALLOC_INDEX") "0" }}
|
||||
global_cache:
|
||||
command: ["/usr/libexec/lemonldap-ng/bin/purgeCentralCache"]
|
||||
cronExpression: "@every 10m"
|
||||
logger:
|
||||
level: debug
|
||||
|
||||
---
|
||||
kind: cron
|
||||
name: clean_global_cache
|
||||
cron: "@every 10m"
|
||||
command: ["/usr/libexec/lemonldap-ng/bin/purgeCentralCache"]
|
||||
{{- end }}
|
||||
|
||||
_EOT
|
||||
destination = "local/caretakerd.yaml"
|
||||
destination = "local/minit.d/lemonldap-ng.yml"
|
||||
}
|
||||
|
||||
resources {
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
FROM [[ .docker.repo ]][[ .docker.base_images.alma9.image ]]
|
||||
MAINTAINER [[ .docker.maintainer ]]
|
||||
|
||||
ARG LLNG_VERSION=2.18.1 \
|
||||
CARETAKERD_VERSION=1.0.8
|
||||
ARG LLNG_VERSION=2.18.1
|
||||
|
||||
ENV PATH=/usr/libexec/lemonldap-ng/bin:${PATH} \
|
||||
LLNG_LISTEN=unix:/tmp/llng.sock \
|
||||
|
@ -45,13 +44,10 @@ RUN set -eux &&\
|
|||
&&\
|
||||
# dnf is an alias using --nodocs, so install doc manually \
|
||||
microdnf -y install lemonldap-ng-doc-${LLNG_VERSION} &&\
|
||||
curl -sSL https://github.com/echocat/caretakerd/releases/download/v${CARETAKERD_VERSION}/caretakerd-linux-amd64.tar.gz | \
|
||||
tar xvz --exclude caretakerd.html -C /usr/local/bin &&\
|
||||
chmod +x /usr/local/bin/caretakerd &&\
|
||||
dnf -y clean all &&\
|
||||
rm -rf /var/cache/yum/* /var/log/yum/* /var/lib/dnf/history*
|
||||
|
||||
COPY root/ /
|
||||
|
||||
USER apache
|
||||
CMD ["caretakerd", "run"]
|
||||
CMD ["minit"]
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
services:
|
||||
lemonldap:
|
||||
type: master
|
||||
command: ["lemonldap-ng"]
|
||||
nginx:
|
||||
command: ["nginx", "-c", "${LLNG_NGINX_CONF}"]
|
||||
local_cache:
|
||||
command: ["/usr/libexec/lemonldap-ng/bin/purgeLocalCache"]
|
||||
cronExpression: '1 * * * *'
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
kind: daemon
|
||||
name: lemonldap
|
||||
command: ["lemonldap-ng"]
|
||||
|
||||
---
|
||||
kind: daemon
|
||||
name: nginx
|
||||
command: ["nginx", "-c", "${LLNG_NGINX_CONF}"]
|
||||
|
||||
---
|
||||
kind: cron
|
||||
name: local_cache
|
||||
command: ["/usr/libexec/lemonldap-ng/bin/purgeLocalCache"]
|
||||
cron: '1 * * * *'
|
|
@ -79,7 +79,7 @@ job "[[ .instance ]]" {
|
|||
LLNG_MANAGER_VHOST = [[ (urlParse .llng.manager.public_url).Hostname | toJSON ]]
|
||||
LLNG_PORTAL_VHOST = [[ (urlParse .llng.portal.public_url).Hostname | toJSON ]]
|
||||
LLNG_CUSTOM_ASSETS_DIR = "/local/assets"
|
||||
CTD_CONFIG = "/local/caretakerd.yaml"
|
||||
MINIT_UNIT_DIR = "/local/minit.d"
|
||||
[[ template "common/proxy_env" $c ]]
|
||||
}
|
||||
|
||||
|
@ -146,12 +146,12 @@ _EOT
|
|||
destination = "local/lmConf-1.json"
|
||||
}
|
||||
|
||||
# caretakerd is the init system used to run LL::NG, nginx and cron tasks
|
||||
# Configure minit to start uwsgi, nginx, cron tasks
|
||||
template {
|
||||
data =<<_EOT
|
||||
[[ template "lemonldap-ng/caretakerd.yaml.tpl" . ]]
|
||||
[[ template "lemonldap-ng/minit.yml.tpl" . ]]
|
||||
_EOT
|
||||
destination = "local/caretakerd.yaml"
|
||||
destination = "local/minit.d/lemonldap-ng.yml"
|
||||
}
|
||||
|
||||
[[ template "common/resources" $c.resources ]]
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
services:
|
||||
lemonldap:
|
||||
type: master
|
||||
command: ["lemonldap-ng"]
|
||||
[[- if ne .llng.portal.cron.clean_local_cache "" ]]
|
||||
local_cache:
|
||||
command: ["/usr/libexec/lemonldap-ng/bin/purgeLocalCache"]
|
||||
cronExpression: [[ .llng.portal.cron.clean_local_cache | toJSON ]]
|
||||
logger:
|
||||
level: debug
|
||||
[[- end ]]
|
||||
nginx:
|
||||
command: ["nginx", "-c", "${LLNG_NGINX_CONF}"]
|
||||
[[- if ne .llng.portal.cron.clean_global_cache "" ]]
|
||||
{{- if eq (env "NOMAD_ALLOC_INDEX") "0" }}
|
||||
global_cache:
|
||||
command: ["/usr/libexec/lemonldap-ng/bin/purgeCentralCache"]
|
||||
cronExpression: [[ .llng.portal.cron.clean_global_cache | toJSON ]]
|
||||
logger:
|
||||
level: debug
|
||||
[[- end ]]
|
||||
[[- if ne .llng.portal.cron.rotate_oidc_keys "" ]]
|
||||
rotate_oidc_keys:
|
||||
command: ["/usr/libexec/lemonldap-ng/bin/rotateOidcKeys"]
|
||||
cronExpression: [[ .llng.portal.cron.rotate_oidc_keys | toJSON ]]
|
||||
logger:
|
||||
level: debug
|
||||
[[- end ]]
|
||||
{{- end }}
|
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
kind: daemon
|
||||
name: lemonldap
|
||||
command: ["lemonldap-ng"]
|
||||
|
||||
---
|
||||
kind: daemon
|
||||
name: nginx
|
||||
command: ["nginx", "-c", "${LLNG_NGINX_CONF}"]
|
||||
|
||||
[[- if ne .llng.portal.cron.clean_local_cache "" ]]
|
||||
|
||||
---
|
||||
kind: cron
|
||||
name: local_cache
|
||||
command: ["/usr/libexec/lemonldap-ng/bin/purgeLocalCache"]
|
||||
cron: [[ .llng.portal.cron.clean_local_cache | toJSON ]]
|
||||
[[- end ]]
|
||||
|
||||
{{- if eq (env "NOMAD_ALLOC_INDEX") "0" }}
|
||||
[[- if ne .llng.portal.cron.clean_global_cache "" ]]
|
||||
|
||||
---
|
||||
kind: cron
|
||||
name: clean_global_cache
|
||||
cron: [[ .llng.portal.cron.clean_global_cache | toJSON ]]
|
||||
command: ["/usr/libexec/lemonldap-ng/bin/purgeCentralCache"]
|
||||
[[- end ]]
|
||||
|
||||
[[- if ne .llng.portal.cron.rotate_oidc_keys "" ]]
|
||||
|
||||
---
|
||||
kind: cron
|
||||
name: rotate_oidc_keys
|
||||
cron: [[ .llng.portal.cron.rotate_oidc_keys | toJSON ]]
|
||||
command: ["/usr/libexec/lemonldap-ng/bin/rotateOidcKeys"]
|
||||
[[- end ]]
|
||||
{{- end }}
|
|
@ -12,7 +12,7 @@ llng:
|
|||
count: 1
|
||||
|
||||
# Docker image to use
|
||||
image: '[[ .docker.repo ]]lemonldap-ng:2.18.1-6'
|
||||
image: '[[ .docker.repo ]]lemonldap-ng:2.18.1-7'
|
||||
|
||||
# Resource allocation
|
||||
resources:
|
||||
|
|
Loading…
Reference in New Issue