2022-09-07 17:39:42 -04:00
|
|
|
FROM golang:1.19-alpine as builder
|
2022-02-14 16:43:50 -05:00
|
|
|
|
|
|
|
ENV XDG_CONFIG_HOME /config
|
|
|
|
ENV XDG_DATA_HOME /data
|
|
|
|
|
|
|
|
RUN set -e \
|
|
|
|
export XCADDY_SETCAP=1; \
|
2022-09-07 17:39:42 -04:00
|
|
|
export version=$(curl -q -LSsf "https://api.github.com/repos/caddyserver/caddy/releases/latest" | jq -r .tag_name | grep '^' || exit 5); \
|
2022-07-06 21:01:20 -04:00
|
|
|
echo ">>>>>>>>>>>>>>> ${version} ###############"
|
2022-02-14 16:43:50 -05:00
|
|
|
|
|
|
|
RUN apk -U upgrade && \
|
2022-09-08 10:45:23 -04:00
|
|
|
apk add jq --no-cache && \
|
2022-02-14 16:43:50 -05:00
|
|
|
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest || exit 10; \
|
2022-09-07 17:39:42 -04:00
|
|
|
xcaddy build ${version} \
|
|
|
|
--output /caddy \
|
2022-02-14 16:43:50 -05:00
|
|
|
--with github.com/caddy-dns/route53 \
|
|
|
|
--with github.com/caddy-dns/cloudflare \
|
|
|
|
--with github.com/caddy-dns/alidns \
|
|
|
|
--with github.com/caddy-dns/dnspod \
|
2022-09-07 17:39:42 -04:00
|
|
|
--with github.com/caddy-dns/rfc2136 \
|
2022-02-14 16:43:50 -05:00
|
|
|
--with github.com/abiosoft/caddy-exec \
|
|
|
|
--with github.com/greenpau/caddy-trace \
|
|
|
|
--with github.com/hairyhenderson/caddy-teapot-module \
|
|
|
|
--with github.com/kirsch33/realip \
|
|
|
|
--with github.com/porech/caddy-maxmind-geolocation \
|
2022-07-06 21:01:20 -04:00
|
|
|
--with github.com/caddyserver/transform-encoder \
|
2022-07-06 21:24:14 -04:00
|
|
|
--with github.com/caddyserver/replace-response
|
2022-02-14 16:43:50 -05:00
|
|
|
|
2022-07-09 13:21:03 -04:00
|
|
|
FROM casjaysdevdocker/php:latest as php
|
2022-02-14 16:43:50 -05:00
|
|
|
COPY --from=builder /caddy /usr/bin/caddy
|
2022-07-06 21:22:04 -04:00
|
|
|
COPY ./config/Caddyfile /etc/caddy/Caddyfile
|
2022-02-14 16:43:50 -05:00
|
|
|
COPY ./data/htdocs/. /usr/share/caddy/
|
|
|
|
|
|
|
|
COPY ./bin/entrypoint-caddy.sh /usr/local/bin/entrypoint-caddy.sh
|
|
|
|
|
|
|
|
FROM php
|
2022-07-06 21:01:20 -04:00
|
|
|
ARG BUILD_DATE="$(date +'%Y-%m-%d %H:%M')"
|
2022-02-14 16:43:50 -05:00
|
|
|
LABEL \
|
|
|
|
org.label-schema.name="caddy" \
|
|
|
|
org.label-schema.description="Alpine based image with caddy and php8." \
|
2022-07-09 13:21:03 -04:00
|
|
|
org.label-schema.url="https://hub.docker.com/r/casjaysdevdocker/caddy" \
|
|
|
|
org.label-schema.vcs-url="https://github.com/casjaysdevdocker/caddy" \
|
2022-02-14 16:43:50 -05:00
|
|
|
org.label-schema.build-date=$BUILD_DATE \
|
|
|
|
org.label-schema.version=$BUILD_DATE \
|
|
|
|
org.label-schema.vcs-ref=$BUILD_DATE \
|
2022-07-09 13:21:03 -04:00
|
|
|
org.label-schema.license="WTFPL" \
|
2022-02-14 16:43:50 -05:00
|
|
|
org.label-schema.vcs-type="Git" \
|
|
|
|
org.label-schema.schema-version="1.0" \
|
|
|
|
org.label-schema.vendor="CasjaysDev" \
|
2022-07-06 21:01:20 -04:00
|
|
|
maintainer="CasjaysDev <docker-admin@casjaysdev.com>"
|
2022-02-14 16:43:50 -05:00
|
|
|
|
|
|
|
EXPOSE 1-65535
|
|
|
|
|
|
|
|
WORKDIR /data/htdocs
|
|
|
|
VOLUME [ "/data", "/config" ]
|
|
|
|
|
2022-09-07 10:01:35 -04:00
|
|
|
ENTRYPOINT [ "tini", "--" ]
|
2022-02-14 16:43:50 -05:00
|
|
|
HEALTHCHECK CMD ["/usr/local/bin/entrypoint-caddy.sh", "healthcheck"]
|
|
|
|
ENTRYPOINT ["/usr/local/bin/entrypoint-caddy.sh"]
|
2022-09-07 10:01:35 -04:00
|
|
|
|