From e7599153590ec5ab72ad8766678bd419ece10d65 Mon Sep 17 00:00:00 2001 From: Ambrose Chua Date: Mon, 9 Oct 2017 18:14:51 +0800 Subject: [PATCH] Initial commit --- Caddyfile | 3 +++ Dockerfile | 37 +++++++++++++++++++++++++++++++++++++ index.html | 8 ++++++++ 3 files changed, 48 insertions(+) create mode 100755 Caddyfile create mode 100755 Dockerfile create mode 100755 index.html diff --git a/Caddyfile b/Caddyfile new file mode 100755 index 0000000..ced9040 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,3 @@ +:2015 { + root /srv +} diff --git a/Dockerfile b/Dockerfile new file mode 100755 index 0000000..0bf88fe --- /dev/null +++ b/Dockerfile @@ -0,0 +1,37 @@ +FROM debian:stable as fetch + +RUN apt-get update && apt install -y --no-install-recommends \ + tar \ + xz-utils \ + curl \ + ca-certificates + +RUN curl --silent --show-error --fail --location -o - \ + "https://caddyserver.com/download/linux/amd64" \ + | tar --no-same-owner -C /usr/bin/ -xz caddy + +RUN curl --silent --show-error --fail --location -o - \ + "https://github.com/upx/upx/releases/download/v3.94/upx-3.94-amd64_linux.tar.xz" \ + | tar --no-same-owner -C /usr/bin/ -xJ \ + --strip-components 1 upx-3.94-amd64_linux/upx + +RUN ls -l /usr/bin/caddy +RUN /usr/bin/upx --ultra-brute /usr/bin/caddy +RUN ls -l /usr/bin/caddy + +RUN /usr/bin/caddy -version + + +FROM scratch + +COPY --from=fetch /usr/bin/caddy /caddy + +EXPOSE 80 443 +VOLUME /.caddy +WORKDIR /srv + +COPY Caddyfile /Caddyfile +COPY index.html /srv/index.html + +ENTRYPOINT ["/caddy"] +CMD ["--conf", "/Caddyfile", "--log", "stdout"] diff --git a/index.html b/index.html new file mode 100755 index 0000000..d0089c1 --- /dev/null +++ b/index.html @@ -0,0 +1,8 @@ + +

+ Hello, Caddy! +

+

+ To use this container, mount your files into /srv. Example: +

docker run -it --rm -p 2015:2015 -v $PWD:/srv serverwentdown/caddy
+