1
0
Fork 0

Initial commit

pull/5/head
Ambrose Chua 2017-10-09 18:14:51 +08:00
commit e759915359
3 changed files with 48 additions and 0 deletions

3
Caddyfile Executable file
View File

@ -0,0 +1,3 @@
:2015 {
root /srv
}

37
Dockerfile Executable file
View File

@ -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"]

8
index.html Executable file
View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<h1>
Hello, Caddy!
</h1>
<p>
To use this container, mount your files into /srv. Example:
<pre>docker run -it --rm -p 2015:2015 -v $PWD:/srv serverwentdown/caddy</pre>
</p>