From 92230e4ade3a88d20e23988dbc5c387566e43642 Mon Sep 17 00:00:00 2001 From: Hu Ji <669898595@qq.com> Date: Sat, 6 Apr 2024 21:11:58 +0800 Subject: [PATCH] add container tags --- src/linktools/assets/containers/100-nginx/Dockerfile | 9 ++------- src/linktools/assets/containers/100-nginx/container.py | 1 + .../assets/containers/110-portainer/compose.yml | 2 +- .../assets/containers/110-portainer/container.py | 1 + src/linktools/assets/containers/120-flare/compose.yml | 2 +- src/linktools/assets/containers/120-flare/container.py | 1 + 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/linktools/assets/containers/100-nginx/Dockerfile b/src/linktools/assets/containers/100-nginx/Dockerfile index 3cf099a5..c451ab6f 100644 --- a/src/linktools/assets/containers/100-nginx/Dockerfile +++ b/src/linktools/assets/containers/100-nginx/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx:alpine +FROM nginx:{{ NGINX_TAG }} RUN apk --no-cache add openssl socat RUN curl https://get.acme.sh | sh -s email=acme@google.com && \ @@ -19,15 +19,10 @@ ENV {{ key }} {{ value }} {%- endwith %} {%- endfor %} -{% if DEBUG %} -RUN acme.sh --issue --debug --domain {{ ROOT_DOMAIN }} --domain *.{{ ROOT_DOMAIN }} --dns {{ ACME_DNS_API }} -{% else %} -RUN acme.sh --issue --domain {{ ROOT_DOMAIN }} --domain *.{{ ROOT_DOMAIN }} --dns {{ ACME_DNS_API }} -{% endif %} +RUN acme.sh --issue --debug --domain {{ ROOT_DOMAIN }} --domain *.{{ ROOT_DOMAIN }} --dns {{ ACME_DNS_API }} RUN acme.sh --install-cert --domain {{ ROOT_DOMAIN }} --domain *.{{ ROOT_DOMAIN }} \ --cert-file /etc/certs/{{ ROOT_DOMAIN }}_cert.pem \ --key-file /etc/certs/{{ ROOT_DOMAIN }}_key.pem \ --fullchain-file /etc/certs/{{ ROOT_DOMAIN }}_fullchain.pem \ --reloadcmd "nginx -s reload 2>/dev/null || true" - diff --git a/src/linktools/assets/containers/100-nginx/container.py b/src/linktools/assets/containers/100-nginx/container.py index 5178a332..578ed562 100644 --- a/src/linktools/assets/containers/100-nginx/container.py +++ b/src/linktools/assets/containers/100-nginx/container.py @@ -49,6 +49,7 @@ def keys(self): @cached_property def configs(self): return dict( + NGINX_TAG="alpine", ROOT_DOMAIN=Config.Prompt(cached=True), WILDCARD_DOMAIN=Config.Confirm(default=False, cached=True), HTTP_PORT=Config.Prompt(default=80, type=int, cached=True), diff --git a/src/linktools/assets/containers/110-portainer/compose.yml b/src/linktools/assets/containers/110-portainer/compose.yml index 4884e179..4c103994 100644 --- a/src/linktools/assets/containers/110-portainer/compose.yml +++ b/src/linktools/assets/containers/110-portainer/compose.yml @@ -1,6 +1,6 @@ services: portainer: - image: portainer/portainer-ce + image: portainer/portainer-ce:{{ PORTAINER_TAG }} # {% if int(PORTAINER_EXPOSE_PORT, 0) > 0 %} ports: - '{{ PORTAINER_EXPOSE_PORT }}:9000' diff --git a/src/linktools/assets/containers/110-portainer/container.py b/src/linktools/assets/containers/110-portainer/container.py index 37d522b2..ae18c45c 100644 --- a/src/linktools/assets/containers/110-portainer/container.py +++ b/src/linktools/assets/containers/110-portainer/container.py @@ -40,6 +40,7 @@ def dependencies(self) -> [str]: @cached_property def configs(self): return dict( + PORTAINER_TAG="alpine", PORTAINER_DOMAIN=self.get_nginx_domain(), PORTAINER_EXPOSE_PORT=None, ) diff --git a/src/linktools/assets/containers/120-flare/compose.yml b/src/linktools/assets/containers/120-flare/compose.yml index 445e59c5..26dee3a6 100644 --- a/src/linktools/assets/containers/120-flare/compose.yml +++ b/src/linktools/assets/containers/120-flare/compose.yml @@ -1,6 +1,6 @@ services: flare: - image: soulteary/flare + image: soulteary/flare:{{ FLARE_TAG }} user: '{{ DOCKER_UID }}:{{ DOCKER_GID }}' # {% if int(FLARE_EXPOSE_PORT, 0) > 0 %} ports: diff --git a/src/linktools/assets/containers/120-flare/container.py b/src/linktools/assets/containers/120-flare/container.py index 0f4a985d..d9685196 100644 --- a/src/linktools/assets/containers/120-flare/container.py +++ b/src/linktools/assets/containers/120-flare/container.py @@ -46,6 +46,7 @@ def configs(self): return dict( WILDCARD_DOMAIN=True, + FLARE_TAG="latest", FLARE_DISABLE_LOGIN=Config.Confirm(default=True, cached=True), FLARE_DOAMIN=self.get_nginx_domain(""), FLARE_EXPOSE_PORT=None,