CaddyDocker/Dockerfile
Fabian Stamm 0f5aa75b90
Some checks failed
continuous-integration/drone/push Build is failing
Updating caddy to 2.2.3
2021-04-15 10:46:28 +02:00

38 lines
697 B
Docker

ARG version=2.2.3
FROM golang:1.14-alpine3.11 AS builder
ARG version
WORKDIR /src
RUN apk add --no-cache \
git \
ca-certificates
RUN go get -u github.com/caddyserver/xcaddy/cmd/xcaddy
ENV CADDY_VERSION="v${version}"
RUN xcaddy build --with github.com/caddy-dns/cloudflare --output /usr/bin/caddy
RUN /usr/bin/caddy version
FROM caddy:${version}
LABEL maintainer "Fabian Stamm <dev@fabianstamm.de>"
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
#Validate install
RUN caddy version
RUN caddy list-modules
EXPOSE 80 443 2019
VOLUME [ "/data", "/config" ]
WORKDIR /srv
COPY Caddyfile /etc/Caddyfile
CMD ["caddy", "run", "--config", "/etc/Caddyfile", "--adapter", "caddyfile"]