First support for caddy 2
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Fabian Stamm 2020-06-18 11:47:31 +02:00
parent bc814e85ef
commit 3486be607c
3 changed files with 48 additions and 19 deletions

21
.drone.yml Normal file
View File

@ -0,0 +1,21 @@
kind: pipeline
type: docker
name: default
steps:
- name: Publish to docker
image: plugins/docker
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
auto_tag: true
repo: hibas123.azurecr.io/caddy
registry: hibas123.azurecr.io
debug: true
when:
branch: [master]
event:
exclude:
- pull_request

3
Caddyfile Normal file
View File

@ -0,0 +1,3 @@
http://0.0.0.0
respond "Caddy is working!"

View File

@ -1,29 +1,34 @@
FROM alpine:3.10 FROM caddy:builder AS builder
RUN caddy-builder \
github.com/caddy-dns/cloudflare
FROM caddy:2.0.0
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
LABEL maintainer "Fabian Stamm <dev@fabianstamm.de>" LABEL maintainer "Fabian Stamm <dev@fabianstamm.de>"
ENV ACME_AGREE="true" # RUN apk add --no-cache \
ENV EMAIL="" # ca-certificates \
# git \
# mailcap \
# openssh-client \
# tzdata \
# bash \
# curl
RUN apk add --no-cache \
ca-certificates \
git \
mailcap \
openssh-client \
tzdata \
bash \
curl
RUN curl https://getcaddy.com | bash -s personal http.cors,http.ratelimit,tls.dns.cloudflare
#Validate install #Validate install
RUN caddy -version RUN caddy version
RUN caddy -plugins RUN caddy list-modules
EXPOSE 80 443 EXPOSE 80 443 2019
VOLUME [ "/data", "/config" ]
VOLUME [ "/root/.caddy", "/src" ]
WORKDIR /srv WORKDIR /srv
CMD ["caddy", "--conf", "/etc/Caddyfile", "--log", "stdout", "--agree=$ACME_AGREE", "--email=$EMAIL"] COPY Caddyfile /etc/Caddyfile
CMD ["caddy", "run", "--config", "/etc/Caddyfile", "--adapter", "caddyfile"]