across/docker/caddy/Dockerfile.architecture

39 lines
1.2 KiB
Docker
Raw Normal View History

# Dockerfile for caddy v1.0.5 based alpine
2024-12-29 23:22:33 +09:00
# Copyright (C) 2021 - 2024 Teddysun <i@teddysun.com>
# Reference URL:
# https://github.com/caddyserver/caddy
# https://github.com/caddyserver/forwardproxy
2024-12-29 23:22:33 +09:00
FROM alpine:3.14
LABEL maintainer="Teddysun <i@teddysun.com>"
ARG TARGETPLATFORM
WORKDIR /root
COPY caddy.sh /root/caddy.sh
RUN set -ex \
&& mkdir -p /config/caddy /data/caddy /etc/caddy /usr/share/caddy \
&& apk add --no-cache tzdata ca-certificates mailcap \
&& chmod +x /root/caddy.sh \
&& /root/caddy.sh "${TARGETPLATFORM}" \
2021-08-26 15:28:10 +09:00
&& rm -fv /root/caddy.sh
# set up nsswitch.conf for Go's "netgo" implementation
# see: https://github.com/docker-library/golang/blob/1eb096131592bcbc90aa3b97471811c798a93573/1.14/alpine3.12/Dockerfile#L9
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
COPY Caddyfile /etc/caddy/Caddyfile
COPY index.html /usr/share/caddy/index.html
# See https://caddyserver.com/docs/conventions#file-locations for details
ENV XDG_CONFIG_HOME /config
ENV XDG_DATA_HOME /data
VOLUME /etc/caddy
VOLUME /config
VOLUME /data
2020-11-12 16:32:39 +09:00
EXPOSE 80 443 2015
ENV TZ=Asia/Shanghai
2020-11-12 16:32:39 +09:00
CMD [ "/usr/bin/caddy", "-conf", "/etc/caddy/Caddyfile", "-agree" ]