diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..1ec904b --- /dev/null +++ b/.drone.yml @@ -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 diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..dc45f37 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,3 @@ +http://0.0.0.0 + +respond "Caddy is working!" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index d2e15f3..ebb3154 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 " -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"] \ No newline at end of file +COPY Caddyfile /etc/Caddyfile + +CMD ["caddy", "run", "--config", "/etc/Caddyfile", "--adapter", "caddyfile"] \ No newline at end of file