diff --git a/docker/korhonen.cc/docker-compose.toml b/docker/korhonen.cc/docker-compose.toml new file mode 100644 index 00000000..dd7e144a --- /dev/null +++ b/docker/korhonen.cc/docker-compose.toml @@ -0,0 +1,24 @@ +[services] + +[services.nginx] +image = "nginx" +container_name = "korhonen.cc" +volumes = ["/docker/korhonen.cc:/korhonen.cc:ro", "./nginx.conf:/etc/nginx/conf.d/default.conf"] +networks = ["proxy"] +restart = "unless-stopped" +labels = [ + "traefik.enable=true", + "traefik.http.routers.korhonen-redirect.entrypoints=http", + "traefik.http.routers.korhonen-redirect.rule=Host(`korhonen.cc`)", + "traefik.http.routers.korhonen-redirect.middlewares=http2https@file", + "traefik.http.routers.korhonen.entrypoints=https", + "traefik.http.routers.korhonen.rule=Host(`korhonen.cc`)", + "traefik.http.routers.korhonen.service=korhonen", + "traefik.docker.network=proxy", + "traefik.http.services.korhonen.loadbalancer.server.port=80", +] + +[networks] + +[networks.proxy] +external = true diff --git a/docker/korhonen.cc/nginx.conf b/docker/korhonen.cc/nginx.conf new file mode 100644 index 00000000..4bda4c89 --- /dev/null +++ b/docker/korhonen.cc/nginx.conf @@ -0,0 +1,20 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + + location / { + root /korhonen.cc; + index index.html; + } + + # Use hugo 404 page + error_page 404 /404.html; + + # Redirect 5xx to standard error pages + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} +