-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stephen Corya
committed
Feb 5, 2024
1 parent
50bc089
commit 1431398
Showing
1 changed file
with
9 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,15 @@ | ||
# Caddy | ||
FROM golang:buster AS caddy-compiler | ||
ARG CADDY_VERSION=2.7.6 | ||
FROM caddy:${CADDY_VERSION}-builder AS builder | ||
|
||
WORKDIR /usr/local/src | ||
RUN xcaddy build \ | ||
--with github.com/lucaslorentz/caddy-docker-proxy/v2 \ | ||
--with github.com/gamalan/caddy-tlsredis \ | ||
--with github.com/caddy-dns/gandi | ||
|
||
RUN apt-get update && apt-get install -y debian-keyring debian-archive-keyring apt-transport-https curl && \ | ||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/xcaddy/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-xcaddy-archive-keyring.gpg && \ | ||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/xcaddy/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-xcaddy.list && \ | ||
apt-get update && \ | ||
apt-get install -y xcaddy && \ | ||
xcaddy build \ | ||
--output /usr/local/bin/caddy \ | ||
--with github.com/shcorya/caddy-docker-proxy \ | ||
--with github.com/gamalan/caddy-tlsredis | ||
FROM caddy:${CADDY_VERSION}-alpine | ||
|
||
# Default Certificates | ||
FROM alpine:3.14 AS alpine | ||
RUN apk add -U --no-cache ca-certificates | ||
COPY --from=builder /usr/bin/caddy /usr/bin/caddy | ||
|
||
##################### | ||
# primary container # | ||
##################### | ||
FROM debian:bookworm-slim | ||
|
||
EXPOSE 80 | ||
EXPOSE 443 | ||
EXPOSE 2019 | ||
|
||
WORKDIR /usr/local/src | ||
|
||
COPY --from=caddy-compiler /usr/local/bin/caddy /usr/local/bin/caddy | ||
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
|
||
ENTRYPOINT ["/usr/local/bin/caddy"] | ||
ENTRYPOINT ["/usr/bin/caddy"] | ||
|
||
CMD ["docker-proxy"] |