Created
March 30, 2020 13:12
-
-
Save anandanand84/c7f9dcd6e29820c249a0d009b51ce117 to your computer and use it in GitHub Desktop.
Docker and Caddy File for proxy Hasura Graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:8001 { | |
proxy /graphql :8080 { | |
without /graphql | |
websocket | |
} | |
proxy / :3001 { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu AS builder | |
RUN apt-get update && apt-get install -y git ca-certificates curl wget | |
RUN curl https://getcaddy.com | bash -s personal docker,http.ipfilter,http.jwt,http.ratelimit,http.realip | |
FROM scratch | |
COPY --from=builder /usr/local/bin/caddy /usr/local/bin/caddy | |
WORKDIR /usr/local/bin/ | |
CMD ["/usr/local/bin/caddy"] | |
FROM alpine:3.10 | |
ENV ACME_AGREE="true" | |
ENV ENABLE_TELEMETRY="false" | |
RUN apk add --no-cache \ | |
ca-certificates \ | |
git \ | |
mailcap \ | |
openssh-client \ | |
tzdata | |
COPY --from=builder /usr/local/bin/caddy /usr/bin/caddy | |
RUN /usr/bin/caddy -version | |
RUN /usr/bin/caddy -plugins | |
EXPOSE 80 443 2015 | |
VOLUME /root/.caddy /srv | |
WORKDIR /srv | |
COPY Caddyfile /etc/Caddyfile | |
ENTRYPOINT ["/usr/bin/caddy"] | |
CMD ["--conf", "/etc/Caddyfile", "--log", "stdout", "--agree=true"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment