diff --git a/Dockerfile b/Dockerfile index c2b2f50..8b779e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,4 +12,5 @@ RUN hugo --minify --environment production --config config.toml FROM code.icb4dc0.de/prskr/ci-images/caddy:latest as final -COPY --from=builder /src/public /usr/share/caddy \ No newline at end of file +COPY --from=builder /src/public /usr/share/caddy/docs/ +COPY deploy/caddy/caddy.json /etc/caddy/caddy.json \ No newline at end of file diff --git a/deploy/caddy/caddy.json b/deploy/caddy/caddy.json new file mode 100644 index 0000000..f4f8bea --- /dev/null +++ b/deploy/caddy/caddy.json @@ -0,0 +1,88 @@ +{ + "apps": { + "http": { + "servers": { + "static": { + "listen": [ + ":3000" + ], + "metrics": {}, + "routes": [ + { + "match": [ + { + "path": [ + "/inetmock/*" + ] + } + ], + "handle": [ + { + "handler": "reverse_proxy", + "upstreams": [ + { + "dial": "gitea-http.gitea.svc.cluster.local:3000" + } + ], + "rewrite": { + "path_regexp": [ + { + "find": "^\\/inetmock", + "replace": "/inetmock/inetmock" + } + ] + } + } + ] + }, + { + "match": [ + { + "path": [ + "/" + ] + } + ], + "handle": [ + { + "handler": "rewrite", + "path_regexp": [ + { + "find": ".*", + "replace": "/docs/" + } + ] + } + ] + }, + { + "handle": [ + { + "handler": "file_server", + "root": "/usr/share/caddy", + "index_names": [ + "index.html" + ] + } + ] + } + ] + }, + "metrics": { + "listen": [ + ":9100" + ], + "routes": [ + { + "handle": [ + { + "handler": "metrics" + } + ] + } + ] + } + } + } + } + } \ No newline at end of file diff --git a/deploy/helm/values.yaml b/deploy/helm/values.yaml index e019f48..3176138 100644 --- a/deploy/helm/values.yaml +++ b/deploy/helm/values.yaml @@ -41,13 +41,13 @@ service: port: 3000 ingress: - enabled: false - className: "" + enabled: true + className: "traefik" annotations: {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" hosts: - - host: chart-example.local + - host: inetmock.icb4dc0.de paths: - path: / pathType: ImplementationSpecific