CaddyDocker/Dockerfile

49 lines
1.3 KiB
Docker
Raw Normal View History

2021-05-23 20:17:14 +00:00
ARG version=2.4.1
2019-12-14 19:13:41 +00:00
2021-05-24 20:04:57 +00:00
FROM golang:1.16-alpine3.13 AS builder
2020-06-26 14:41:42 +00:00
ARG version
2020-06-18 09:47:31 +00:00
2020-06-26 14:41:42 +00:00
WORKDIR /src
2019-12-14 19:13:41 +00:00
2020-06-26 14:41:42 +00:00
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
2019-12-14 19:13:41 +00:00
2020-06-26 14:41:42 +00:00
RUN /usr/bin/caddy version
2021-04-15 09:13:18 +00:00
FROM alpine:3
2020-06-18 09:47:31 +00:00
LABEL maintainer "Fabian Stamm <dev@fabianstamm.de>"
2019-12-14 19:13:41 +00:00
2021-04-15 09:13:18 +00:00
RUN echo http://dl-cdn.alpinelinux.org/alpine/v3.9/community >> /etc/apk/repositories
RUN apk add --no-cache openssl libxml2 php7 php7-fpm php7-opcache php7-curl php7-ctype php7-dom php7-gd php7-iconv \
php7-json php7-xml php7-mbstring php7-openssl php7-posix php7-session php7-simplexml php7-xmlreader php7-xmlwriter \
php7-zip php7-zlib php7-pdo_sqlite php7-pdo_mysql php7-pdo_pgsql php7-fileinfo php7-bz2 php7-intl php7-ldap \
php7-ftp php7-imap php7-bcmath php7-gmp php7-exif
2020-06-26 14:41:42 +00:00
2021-04-21 17:54:57 +00:00
RUN cat /etc/php7/php-fpm.d/www.conf | sed 's/listen = 127.0.0.1:9000/listen = \/run\/php-fpm.sock/g' > /etc/php7/php-fpm.d/www.conf
2021-04-21 17:42:01 +00:00
2020-06-26 14:41:42 +00:00
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
2019-12-14 19:13:41 +00:00
#Validate install
2020-06-18 09:47:31 +00:00
RUN caddy version
RUN caddy list-modules
2019-12-14 19:13:41 +00:00
2020-06-18 09:47:31 +00:00
EXPOSE 80 443 2019
VOLUME [ "/data", "/config" ]
2019-12-14 19:13:41 +00:00
WORKDIR /srv
2020-06-18 09:47:31 +00:00
COPY Caddyfile /etc/Caddyfile
2021-04-21 17:42:01 +00:00
COPY start.sh /start.sh
RUN chmod +x /start.sh
CMD ["/bin/sh", "/start.sh"]