diff --git a/.concourse/pipeline.yml b/.concourse/pipeline.yml index 36dbcbb..7e598c9 100644 --- a/.concourse/pipeline.yml +++ b/.concourse/pipeline.yml @@ -12,6 +12,11 @@ resources: source: uri: https://code.icb4dc0.de/prskr/blog.git +- name: caddy-image + type: docker-image + source: + repository: code.icb4dc0.de/prskr/ci-images/caddy + - name: blog-chart type: helm source: @@ -26,6 +31,8 @@ jobs: plan: - get: blog.git trigger: true + - get: caddy-image + trigger: true - task: build-container-image file: blog.git/.concourse/tasks/image.yml input_mapping: {repo: blog.git} diff --git a/Dockerfile b/Dockerfile index 18e7e9e..4125bd5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,7 @@ FROM docker.io/alpine:latest as builder WORKDIR /tmp -RUN apk add -U --no-cache hugo curl tar jq && \ - export CADDY_VERSION=$(curl https://api.github.com/repos/caddyserver/caddy/releases/latest | jq -r '.tag_name | (sub("v";""))') && \ - curl -L https://github.com/caddyserver/caddy/releases/download/v${CADDY_VERSION}/caddy_${CADDY_VERSION}_linux_amd64.tar.gz | tar -xvz caddy +RUN apk add -U --no-cache hugo WORKDIR /src @@ -12,13 +10,6 @@ COPY . /src/ RUN hugo --minify --environment production --config config.toml -FROM gcr.io/distroless/static as final +FROM code.icb4dc0.de/prskr/ci-images/caddy:latest as final -COPY --from=builder /tmp/caddy /bin -COPY --from=builder /src/public /usr/share/caddy -COPY deploy/caddy/caddy.json /etc/caddy/caddy.json - -EXPOSE 3000 - -ENTRYPOINT [ "/bin/caddy" ] -CMD [ "run", "--config=/etc/caddy/caddy.json" ] \ No newline at end of file +COPY --from=builder /src/public /usr/share/caddy \ No newline at end of file diff --git a/deploy/caddy/caddy.json b/deploy/caddy/caddy.json deleted file mode 100644 index 94d9243..0000000 --- a/deploy/caddy/caddy.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "apps": { - "http": { - "servers": { - "blog": { - "listen": [ - ":3000" - ], - "metrics": {}, - "routes": [ - { - "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