feat(caddy): prepare caddy image

This commit is contained in:
Peter 2022-12-30 14:39:09 +01:00
parent 2f2181f222
commit df70dffebe
Signed by: prskr
GPG key ID: C1DB5D2E8DB512F9
5 changed files with 108 additions and 0 deletions

30
.concourse/pipeline.yml Normal file
View file

@ -0,0 +1,30 @@
---
resources:
- name: ci-images.git
type: git
icon: github
source:
uri: https://code.icb4dc0.de/prskr/ci-images.git
- name: caddy-release
type: github-release
icon: github
source:
owner: caddyserver
repository: caddy
jobs:
- name: images
plan:
- get: ci-images.git
trigger: true
- get: caddy-release
trigger: true
params:
globs:
- caddy_*_linux_amd64.tar.gz
- task: caddy
file: ci-images.git/.concourse/tasks/caddy.yml
input_mapping:
repo: ci-images.git
caddy: caddy-release

View file

@ -0,0 +1,27 @@
---
platform: linux
image_resource:
type: registry-image
source:
repository: gcr.io/kaniko-project/executor
tag: debug
inputs:
- name: repo
path: .
- name: caddy
path: caddy/caddy-release
params:
GITEA_USER: ((gitea-credentials.user))
GITEA_TOKEN: ((gitea-credentials.token))
run:
path: sh
args:
- -cex
- |
echo "{\"auths\": {\"https://code.icb4dc0.de\": {\"auth\" : \"$(printf '%s:%s' $GITEA_USER $GITEA_TOKEN | base64)\" }}}" > /kaniko/.docker/config.json
/kaniko/executor --destination code.icb4dc0.de/prskr/ci-images/caddy:latest --context caddy/

1
caddy/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
caddy-release/

9
caddy/Dockerfile Normal file
View file

@ -0,0 +1,9 @@
FROM gcr.io/distroless/static
ADD caddy-release/caddy_*_linux_amd64.tar.gz /usr/local/caddy
COPY config/caddy.json /etc/caddy/caddy.json
EXPOSE 3000
ENTRYPOINT [ "/usr/local/caddy/caddy" ]
CMD [ "run", "--config=/etc/caddy/caddy.json" ]

41
caddy/config/caddy.json Normal file
View file

@ -0,0 +1,41 @@
{
"apps": {
"http": {
"servers": {
"static": {
"listen": [
":3000"
],
"metrics": {},
"routes": [
{
"handle": [
{
"handler": "file_server",
"root": "/usr/share/caddy",
"index_names": [
"index.html"
]
}
]
}
]
},
"metrics": {
"listen": [
":9100"
],
"routes": [
{
"handle": [
{
"handler": "metrics"
}
]
}
]
}
}
}
}
}