From 26b8e90376838e14cab0c78157e1259acf8645f9 Mon Sep 17 00:00:00 2001 From: Florian du Garage Num Date: Sat, 16 Dec 2023 14:04:40 +0100 Subject: [PATCH] Dockerfile deploy --- Dockerfile | 10 ++++++++++ config.toml | 6 +++--- nginx.conf.sigil | 3 ++- 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cc55b72 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +# Use an image that includes both Hugo and Nginx +FROM hugomods/hugo:0.111.3 AS builder +COPY . /src +WORKDIR /src +RUN hugo --minify --gc + +FROM hugomods/hugo:nginx +#COPY --from=builder /src/public /usr/share/nginx/html +COPY --from=builder /src/public /site +# Default Nginx config should be sufficient for serving static content diff --git a/config.toml b/config.toml index b164e0b..40dc09b 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,6 @@ -baseURL = 'https://ltqf.fr' +baseURL = 'https://ltqf.fr/' #relativeURLs = "False" -languageCode = 'en-us' +languageCode = 'fr' title = "Compagnie Le Temps Qu'il Faut" buildFuture= true enableRobotsTXT = true @@ -45,4 +45,4 @@ hugoVersion = "0.111.3" [[menu.main]] name = "Contact" url = "/contact" - weight = 7 \ No newline at end of file + weight = 7 diff --git a/nginx.conf.sigil b/nginx.conf.sigil index c569ce9..8c9b49a 100644 --- a/nginx.conf.sigil +++ b/nginx.conf.sigil @@ -14,7 +14,7 @@ server { {{ if (and (eq $listen_port "80") ($.SSL_INUSE)) }} include {{ $.DOKKU_ROOT }}/{{ $.APP }}/nginx.conf.d/*.conf; location / { - return 301 https://$host:{{ $.PROXY_SSL_PORT }}$request_uri; + return 301 https://{{SSL_SERVER_NAME}}:{{ $.PROXY_SSL_PORT }}$request_uri; } {{ else }} location / { @@ -111,6 +111,7 @@ server { location ~* \.(jpg|jpeg|gif|png|webp|svg|ico)$ { expires 1y; add_header Cache-Control "public"; + proxy_pass http://{{ $.APP }}-{{ $upstream_port }}; } {{ if $.CLIENT_MAX_BODY_SIZE }}client_max_body_size {{ $.CLIENT_MAX_BODY_SIZE }};{{ end }}