From ce3b0156f0e8b1e5adb201c87f27b12e45dbf5e1 Mon Sep 17 00:00:00 2001 From: mo8it Date: Sun, 27 Aug 2023 23:09:18 +0200 Subject: [PATCH] Try new Nginx config --- containers/mo8it.com.fish | 16 +++++++-- volumes/nginx.conf | 36 +++++++++++++++++++ .../nginx/conf.d/how-to-linux.mo8it.com.conf | 11 ------ volumes/traefik/dynamic.yml | 3 +- 4 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 volumes/nginx.conf delete mode 100644 volumes/nginx/conf.d/how-to-linux.mo8it.com.conf diff --git a/containers/mo8it.com.fish b/containers/mo8it.com.fish index 01d4e44..3ab3923 100755 --- a/containers/mo8it.com.fish +++ b/containers/mo8it.com.fish @@ -1,10 +1,20 @@ #!/usr/bin/env fish -set -l container_name mo8it_com +set -l container_name mo8it-com -buildah build --layers -t $container_name:latest ~/code/mo8it.com +mkdir -p ~/volumes/$container_name + +podman run \ + --rm \ + -v ~/code/mo8it.com:/volumes/src:Z,ro \ + -v ~/volumes/$container_name:/volumes/public:Z \ + -w /volumes/src \ + ghcr.io/getzola/zola:v0.17.2 build -o /volumes/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:/usr/share/nginx/html:Z,ro \ + --label "io.containers.autoupdate=registry" \ + docker.io/library/nginx:alpine diff --git a/volumes/nginx.conf b/volumes/nginx.conf new file mode 100644 index 0000000..3d574f6 --- /dev/null +++ b/volumes/nginx.conf @@ -0,0 +1,36 @@ +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log error; + +events { + worker_connections 1024; +} + +http { + charset utf-8; + + access_log off; + log_not_found off; + + sendfile on; + tcp_nopush on; + tcp_nodelay on; + + gzip on; + + server_tokens off; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + server { + root /usr/share/nginx/html; + index index.html; + + location / { + } + + error_page 404 /404.html; + } +} diff --git a/volumes/nginx/conf.d/how-to-linux.mo8it.com.conf b/volumes/nginx/conf.d/how-to-linux.mo8it.com.conf deleted file mode 100644 index dff4faa..0000000 --- a/volumes/nginx/conf.d/how-to-linux.mo8it.com.conf +++ /dev/null @@ -1,11 +0,0 @@ -server { - listen 80; - server_name how-to-linux.mo8it.com; - - location / { - root /volumes/sites/how-to-linux.mo8it.com; - index index.html; - } - - error_page 404 /404.html; -} diff --git a/volumes/traefik/dynamic.yml b/volumes/traefik/dynamic.yml index 7913e7f..45bcddf 100644 --- a/volumes/traefik/dynamic.yml +++ b/volumes/traefik/dynamic.yml @@ -136,7 +136,6 @@ http: certResolver: le {{ end }} - services: nginx: loadBalancer: @@ -193,7 +192,7 @@ http: mo8it_com: loadBalancer: servers: - - url: http://mo8it_com + - url: http://mo8it-com juna_li_com: loadBalancer: servers: