-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (22 loc) · 924 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# syntax = docker/dockerfile:1.2
ARG BUILDER_VERSION=2.8.4
ARG CADDY_VERSION=2.8.4
FROM caddy:${BUILDER_VERSION}-builder-alpine AS builder
ARG CADDY_VERSION
RUN --mount=type=cache,target=/go/pkg/mod \
xcaddy build v${CADDY_VERSION} \
--with github.com/caddy-dns/cloudflare \
--with github.com/mholt/caddy-ratelimit \
--with github.com/greenpau/caddy-security \
--with github.com/mholt/caddy-l4 \
--with github.com/caddyserver/forwardproxy
FROM caddy:alpine AS final-debug
RUN apk add --no-cache ca-certificates
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
FROM scratch AS final
COPY --from=final-debug /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
# See https://caddyserver.com/docs/conventions#file-locations for details
ENV XDG_CONFIG_HOME /config
ENV XDG_DATA_HOME /data
ENTRYPOINT ["/usr/bin/caddy"]