From 306484b664b0ef3ab68a55e5654cabe66fa04e42 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Mon, 23 May 2022 08:47:38 +0200 Subject: [PATCH] Add blog --- Caddyfile | 12 ++++++++++-- Dockerfile | 12 +++--------- conf/nginx.conf | 19 +++++++++++++++++++ config.yaml | 2 +- docker-compose.dev.yaml | 7 +++++++ docker-compose.prod.yaml | 1 - 6 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 conf/nginx.conf create mode 100644 docker-compose.dev.yaml diff --git a/Caddyfile b/Caddyfile index 9ae50a1..b699cb9 100644 --- a/Caddyfile +++ b/Caddyfile @@ -1,2 +1,10 @@ -root * /usr/share/caddy -file_server +{ + auto_https off + debug + http_port: 80 +} + +blog.kasperhermansen.com { + root * /usr/share/caddy + file_server +} diff --git a/Dockerfile b/Dockerfile index 0857204..643352d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,4 @@ -FROM klakegg/hugo:0.93.2-onbuild as builder -COPY . /src - -FROM caddy:2.1.1 as run - -COPY --from=builder /target/ /usr/share/caddy/ - -COPY ./Caddyfile /etc/caddy/Caddyfile - +FROM klakegg/hugo:0.93.2-onbuild AS hugo +FROM nginx +COPY --from=hugo /target /usr/share/nginx/html diff --git a/conf/nginx.conf b/conf/nginx.conf new file mode 100644 index 0000000..f326976 --- /dev/null +++ b/conf/nginx.conf @@ -0,0 +1,19 @@ +http { + include mime.types; + sendfile on; + + server { + listen 80; + listen [::]:80; + + autoindex off; + + server_name _; + server_tokens off; + + root /usr/share/nginx/html; + gzip_static on; + } +} + +events {} diff --git a/config.yaml b/config.yaml index 6f852ee..f1a8cd9 100644 --- a/config.yaml +++ b/config.yaml @@ -1,5 +1,5 @@ languageCode: "en-us" -baseUrl: "blog.kasperhermansen.com" +baseUrl: "https://blog.kasperhermansen.com" title: "Kjuulh" theme: "anubis" paginate: 10 diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml new file mode 100644 index 0000000..de7c52f --- /dev/null +++ b/docker-compose.dev.yaml @@ -0,0 +1,7 @@ +services: + kasperhermansen_blog: + build: + context: . + restart: always + ports: + - 15000:80 diff --git a/docker-compose.prod.yaml b/docker-compose.prod.yaml index e639c79..fcbd94f 100644 --- a/docker-compose.prod.yaml +++ b/docker-compose.prod.yaml @@ -4,4 +4,3 @@ services: restart: always ports: - 15000:80 - - 15001:443