feat: enable metrics
This commit is contained in:
parent
6c791e0492
commit
9a0fbaadce
4 changed files with 51 additions and 10 deletions
20
Dockerfile
20
Dockerfile
|
@ -1,12 +1,24 @@
|
|||
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
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
COPY . /src/
|
||||
|
||||
RUN apk add -U hugo && \
|
||||
hugo --minify --environment production --config config.toml
|
||||
RUN hugo --minify --environment production --config config.toml
|
||||
|
||||
FROM docker.io/caddy:2-alpine
|
||||
FROM gcr.io/distroless/static as final
|
||||
|
||||
COPY --from=builder /src/public /usr/share/caddy
|
||||
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" ]
|
30
deploy/caddy/caddy.json
Normal file
30
deploy/caddy/caddy.json
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"apps": {
|
||||
"http": {
|
||||
"servers": {
|
||||
"blog": {
|
||||
"listen": [
|
||||
":3000"
|
||||
],
|
||||
"routes": [
|
||||
{
|
||||
"handle": [
|
||||
{
|
||||
"handler": "file_server",
|
||||
"root": "/usr/share/caddy",
|
||||
"index_names": [
|
||||
"index.html"
|
||||
],
|
||||
"pass_thru": true
|
||||
},
|
||||
{
|
||||
"handler": "metrics"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -34,15 +34,15 @@ spec:
|
|||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 80
|
||||
containerPort: 3000
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
path: /metrics
|
||||
port: http
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
path: /metrics
|
||||
port: http
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
|
|
|
@ -10,8 +10,7 @@ image:
|
|||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: "latest"
|
||||
|
||||
imagePullSecrets:
|
||||
- name: ghcr-login-secret
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
|
@ -30,7 +29,7 @@ securityContext: {}
|
|||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
port: 3000
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
|
|
Loading…
Reference in a new issue