about summary refs log tree commit diff stats
path: root/Dockerfile
blob: 512d6c23d06276a811bca2b1a5c30881a9547c70 (plain)
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
ARG VERSION=2.6
ARG VARIANT=alpine

FROM docker.io/caddy:${VERSION}-builder-${VARIANT} AS builder

RUN xcaddy build \
    --with github.com/gamalan/caddy-tlsredis \
    --with github.com/sebastianbrunnert/caddy-advanced-metrics

FROM docker.io/caddy:${VERSION}-${VARIANT}

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

COPY Caddyfile /etc/caddy/
COPY public /srv

EXPOSE 9091/tcp

ENV SITE_ROOT=/srv

RUN mkdir /etc/caddy/globals/
RUN touch /etc/caddy/globals/dummy
RUN ["/usr/bin/caddy", "validate", "--config", "/etc/caddy/Caddyfile"]

COPY redis.Caddyfile /etc/caddy/globals/redis