From 48de8efff921cb44080814465942b6f7d903590c Mon Sep 17 00:00:00 2001 From: mo8it Date: Sun, 27 Aug 2023 23:58:30 +0200 Subject: [PATCH] Use new Nginx setup --- containers/dev_tools.fish | 11 ++++++---- ...ia_course_export.fish => how_2_julia.fish} | 6 +++--- containers/juna-li.fish | 10 ---------- containers/juna_li.fish | 20 +++++++++++++++++++ containers/mo8it.com.fish | 6 +++--- containers/nginx.fish | 12 ----------- containers/yinghong_massage.fish | 14 +++++++++++-- volumes/traefik/dynamic.yml | 20 +++++++------------ 8 files changed, 52 insertions(+), 47 deletions(-) rename containers/{julia_course_export.fish => how_2_julia.fish} (53%) delete mode 100755 containers/juna-li.fish create mode 100755 containers/juna_li.fish delete mode 100755 containers/nginx.fish diff --git a/containers/dev_tools.fish b/containers/dev_tools.fish index ebf83e2..017c0ff 100755 --- a/containers/dev_tools.fish +++ b/containers/dev_tools.fish @@ -2,11 +2,14 @@ set -l container_name dev-tools -cd ~/code/dev_tools -mdbook build -buildah build --layers -t $container_name:latest .; or return 1 +mkdir -p ~/volumes/$container_name + +mdbook build -d ~/volumes/$container_name ~/code/dev_tools; or return 1 podman-default-create \ $container_name \ --network traefik \ - localhost/$container_name:latest + -v ~/sync/volumes/nginx.conf:/etc/nginx/nginx.conf:z,ro \ + -v ~/volumes/$container_name:/usr/share/nginx/html:Z,ro \ + --label "io.containers.autoupdate=registry" \ + docker.io/library/nginx:alpine diff --git a/containers/julia_course_export.fish b/containers/how_2_julia.fish similarity index 53% rename from containers/julia_course_export.fish rename to containers/how_2_julia.fish index c596e1d..5b810bf 100755 --- a/containers/julia_course_export.fish +++ b/containers/how_2_julia.fish @@ -1,11 +1,11 @@ #!/usr/bin/env fish -set -l container_name julia_course_export -set -l container_volume ~/code/julia_course_export +set -l container_name how-2-julia podman-default-create \ $container_name \ --network traefik \ - -v $container_volume:/usr/share/nginx/html:Z,ro \ + -v ~/sync/volumes/nginx.conf:/etc/nginx/nginx.conf:z,ro \ + -v ~/code/how_2_julia:/usr/share/nginx/html:Z,ro \ --label "io.containers.autoupdate=registry" \ docker.io/library/nginx:alpine diff --git a/containers/juna-li.fish b/containers/juna-li.fish deleted file mode 100755 index 4b090fd..0000000 --- a/containers/juna-li.fish +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env fish - -set -l container_name juna_li_com - -buildah build --layers -t $container_name:latest ~/code/juna-li.com - -podman-default-create \ - $container_name \ - --network traefik \ - localhost/$container_name:latest diff --git a/containers/juna_li.fish b/containers/juna_li.fish new file mode 100755 index 0000000..3b9031a --- /dev/null +++ b/containers/juna_li.fish @@ -0,0 +1,20 @@ +#!/usr/bin/env fish + +set -l container_name juna-li-com + +mkdir -p ~/volumes/$container_name + +podman run \ + --rm \ + -v ~/code/juna-li.com:/volumes/src:Z,ro \ + -v ~/volumes/$container_name:/volumes/output:Z \ + -w /volumes/src \ + ghcr.io/getzola/zola:v0.17.2 build -o /volumes/output/public -f; or return 1 + +podman-default-create \ + $container_name \ + --network traefik \ + -v ~/sync/volumes/nginx.conf:/etc/nginx/nginx.conf:z,ro \ + -v ~/volumes/$container_name/public:/usr/share/nginx/html:Z,ro \ + --label "io.containers.autoupdate=registry" \ + docker.io/library/nginx:alpine diff --git a/containers/mo8it.com.fish b/containers/mo8it.com.fish index 3ab3923..e36329e 100755 --- a/containers/mo8it.com.fish +++ b/containers/mo8it.com.fish @@ -7,14 +7,14 @@ mkdir -p ~/volumes/$container_name podman run \ --rm \ -v ~/code/mo8it.com:/volumes/src:Z,ro \ - -v ~/volumes/$container_name:/volumes/public:Z \ + -v ~/volumes/$container_name:/volumes/output:Z \ -w /volumes/src \ - ghcr.io/getzola/zola:v0.17.2 build -o /volumes/public -f; or return 1 + ghcr.io/getzola/zola:v0.17.2 build -o /volumes/output/public -f; or return 1 podman-default-create \ $container_name \ --network traefik \ -v ~/sync/volumes/nginx.conf:/etc/nginx/nginx.conf:z,ro \ - -v ~/volumes/$container_name:/usr/share/nginx/html:Z,ro \ + -v ~/volumes/$container_name/public:/usr/share/nginx/html:Z,ro \ --label "io.containers.autoupdate=registry" \ docker.io/library/nginx:alpine diff --git a/containers/nginx.fish b/containers/nginx.fish deleted file mode 100755 index bc1d5ca..0000000 --- a/containers/nginx.fish +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env fish - -set -l container_name nginx -set -l container_volumes_dir ~/volumes/$container_name - -podman-default-create \ - $container_name \ - --network traefik \ - -v $container_volumes_dir/sites:/volumes/sites:z,ro \ - -v ~/sync/volumes/$container_name/conf.d:/etc/nginx/conf.d:Z,ro \ - --label "io.containers.autoupdate=registry" \ - docker.io/library/nginx:alpine diff --git a/containers/yinghong_massage.fish b/containers/yinghong_massage.fish index c41d616..a04aa8d 100755 --- a/containers/yinghong_massage.fish +++ b/containers/yinghong_massage.fish @@ -2,9 +2,19 @@ set -l container_name yinghong-massage-de -buildah build --layers -t $container_name:latest ~/code/yinghong-massage.de +mkdir -p ~/volumes/$container_name + +podman run \ + --rm \ + -v ~/code/yinghong-massage.de:/volumes/src:Z,ro \ + -v ~/volumes/$container_name:/volumes/output:Z \ + -w /volumes/src \ + ghcr.io/getzola/zola:v0.17.2 build -o /volumes/output/public -f; or return 1 podman-default-create \ $container_name \ --network traefik \ - localhost/$container_name:latest + -v ~/sync/volumes/nginx.conf:/etc/nginx/nginx.conf:z,ro \ + -v ~/volumes/$container_name/public:/usr/share/nginx/html:Z,ro \ + --label "io.containers.autoupdate=registry" \ + docker.io/library/nginx:alpine diff --git a/volumes/traefik/dynamic.yml b/volumes/traefik/dynamic.yml index 45bcddf..02c39be 100644 --- a/volumes/traefik/dynamic.yml +++ b/volumes/traefik/dynamic.yml @@ -21,11 +21,6 @@ http: regex: "^(https://[a-z-]+\\.mo8it\\.)xyz(.*)" replacement: "${1}com${2}" permanent: true - xueyue_li_art_to_juna_li_com: - redirectRegex: - regex: "^https://(www\\.)?xueyue-li\\.art(.*)" - replacement: "https://juna-li.com${2}" - permanent: true oxiform_ratelimit: rateLimit: average: 2 @@ -44,9 +39,8 @@ http: routers: to_juna_li_com: - rule: Host(`juna-li.com`) || Host(`www.juna-li.com`) || Host(`xueyue-li.art`)|| Host(`www.xueyue-li.art`) + rule: Host(`juna-li.com`) || Host(`www.juna-li.com`) middlewares: - - xueyue_li_art_to_juna_li_com - remove_www_juna_li_com service: juna_li_com to_advlabdb: @@ -91,9 +85,9 @@ http: to_lldap: rule: Host(`ldap.mo8it.com`) service: lldap - to_julia_course_export: - rule: Host(`julia-course.mo8it.com`) - service: julia_course_export + to_how_2_julia: + rule: Host(`how-2-julia.mo8it.com`) + service: how_2_julia to_oxiform: rule: Host(`oxiform.mo8it.com`) priority: 1 @@ -177,10 +171,10 @@ http: loadBalancer: servers: - url: http://lldap:17170 - julia_course_export: + how_2_julia: loadBalancer: servers: - - url: http://julia_course_export + - url: http://how-2-julia oxiform: loadBalancer: servers: @@ -196,7 +190,7 @@ http: juna_li_com: loadBalancer: servers: - - url: http://juna_li_com + - url: http://juna-li-com yinghong_massage_de: loadBalancer: servers: