CaddyDocker/Dockerfile
Fabian Stamm 1d936181e7
All checks were successful
continuous-integration/drone/push Build is passing
Start php
2021-04-21 19:42:01 +02:00

46 lines
923 B
Docker

ARG version=2.1.1
FROM golang:1.14-alpine3.11 AS builder
ARG version
WORKDIR /src
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
RUN /usr/bin/caddy version
FROM alpine:3
LABEL maintainer "Fabian Stamm <dev@fabianstamm.de>"
RUN echo http://dl-cdn.alpinelinux.org/alpine/v3.9/community >> /etc/apk/repositories
RUN apk add --no-cache php7 php7-fpm php7-opcache php7-curl php7-json php7-zip
RUN sed 's/listen = 127.0.0.1:9000/listen = \/run\/php-fpm.sock/g'
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
#Validate install
RUN caddy version
RUN caddy list-modules
EXPOSE 80 443 2019
VOLUME [ "/data", "/config" ]
WORKDIR /srv
COPY Caddyfile /etc/Caddyfile
COPY start.sh /start.sh
RUN chmod +x /start.sh
CMD ["/bin/sh", "/start.sh"]