forked from szaimen/aio-caddy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (24 loc) · 829 Bytes
/
Dockerfile
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
FROM caddy:2.7.6-builder-alpine AS builder
ENV CADDY_HASH 8794ba5a3a9ff1cac49f9c40aed2841646de0324
RUN set -ex; \
xcaddy build --with github.com/porech/caddy-maxmind-geolocation@"$CADDY_HASH"
FROM alpine:3.19.1
# hadolint ignore=DL3018
RUN set -ex; \
apk add --no-cache shadow; \
groupmod -g 333 xfs; \
usermod -u 333 -g 333 xfs; \
groupdel www-data; \
addgroup -g 33 -S www-data; \
adduser -u 33 -D -S -G www-data www-data; \
apk del shadow; \
apk add --no-cache tzdata bash bind-tools netcat-openbsd util-linux-misc; \
mkdir -p /data/caddy; \
chown 33:33 -R /data; \
chmod 770 -R /data
VOLUME /data
COPY --from=builder /usr/bin/caddy /usr/local/bin/caddy
COPY --chmod=775 start.sh /start.sh
COPY --chown=33:33 Caddyfile /Caddyfile
USER www-data
ENTRYPOINT [ "/start.sh" ]