forked from caddyserver/caddy-docker
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.windows.tmpl
47 lines (38 loc) · 1.98 KB
/
Dockerfile.windows.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{{ .base | strings.TrimSpace }}
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN mkdir /config; \
mkdir /data; \
mkdir /etc/caddy; \
mkdir /usr/share/caddy; \
Invoke-WebRequest \
-Uri "https://github.com/caddyserver/dist/raw/{{ .config.dist_commit }}/config/Caddyfile" \
-OutFile "/etc/caddy/Caddyfile"; \
Invoke-WebRequest \
-Uri "https://github.com/caddyserver/dist/raw/{{ .config.dist_commit }}/welcome/index.html" \
-OutFile "/usr/share/caddy/index.html"
# https://github.com/caddyserver/caddy/releases
ENV CADDY_VERSION v{{ .config.caddy_version }}
RUN Invoke-WebRequest \
-Uri "https://github.com/caddyserver/caddy/releases/download/v{{ .config.caddy_version }}/caddy_{{ .config.caddy_version }}_windows_amd64.zip" \
-OutFile "/caddy.zip"; \
if (!(Get-FileHash -Path /caddy.zip -Algorithm SHA512).Hash.ToLower().Equals('{{ .config.checksums.windows_amd64 }}')) { exit 1; }; \
Expand-Archive -Path "/caddy.zip" -DestinationPath "/" -Force; \
Remove-Item "/caddy.zip" -Force
# See https://caddyserver.com/docs/conventions#file-locations for details
ENV XDG_CONFIG_HOME c:/config
ENV XDG_DATA_HOME c:/data
LABEL org.opencontainers.image.version=v{{ .config.caddy_version }}
LABEL org.opencontainers.image.title=Caddy
LABEL org.opencontainers.image.description="a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go"
LABEL org.opencontainers.image.url=https://caddyserver.com
LABEL org.opencontainers.image.documentation=https://caddyserver.com/docs
LABEL org.opencontainers.image.vendor="Light Code Labs"
LABEL org.opencontainers.image.licenses=Apache-2.0
LABEL org.opencontainers.image.source="https://github.com/caddyserver/caddy-docker"
EXPOSE 80
EXPOSE 443
EXPOSE 443/udp
EXPOSE 2019
# Make sure it runs and reports its version
RUN ["caddy", "version"]
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]