Skip to content

Commit

Permalink
try recommended build
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Corya committed Feb 5, 2024
1 parent 50bc089 commit 1431398
Showing 1 changed file with 9 additions and 30 deletions.
39 changes: 9 additions & 30 deletions Dockerfile
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"]

0 comments on commit 1431398

Please sign in to comment.