First support for caddy 2
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone/push Build is passing Details

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>"
ENV ACME_AGREE="true"
ENV EMAIL=""
# RUN apk add --no-cache \
# 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
RUN caddy -version
RUN caddy -plugins
RUN caddy version
RUN caddy list-modules
EXPOSE 80 443
EXPOSE 80 443 2019
VOLUME [ "/data", "/config" ]
VOLUME [ "/root/.caddy", "/src" ]
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"]