feat(caddy): prepare caddy image
This commit is contained in:
parent
2f2181f222
commit
df70dffebe
5 changed files with 108 additions and 0 deletions
30
.concourse/pipeline.yml
Normal file
30
.concourse/pipeline.yml
Normal 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
|
27
.concourse/tasks/caddy.yml
Normal file
27
.concourse/tasks/caddy.yml
Normal 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
1
caddy/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
caddy-release/
|
9
caddy/Dockerfile
Normal file
9
caddy/Dockerfile
Normal 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
41
caddy/config/caddy.json
Normal 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"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue