Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

build(static): ship one caddy binary instead of two

Hampus25bc031b9ce5
diff --git a/fluxer_static/Dockerfile b/fluxer_static/Dockerfile
index a9831116e..753efa853 100644
--- a/fluxer_static/Dockerfile
+++ b/fluxer_static/Dockerfile
@@ -6,7 +6,10 @@ RUN apk add --no-cache curl
COPY fluxer_static/fetch-spellcheck-dictionaries.sh fluxer_static/spellcheck-dictionaries.sha256 /src/
RUN sh /src/fetch-spellcheck-dictionaries.sh /dictionaries
-FROM caddy:2.11-alpine
+FROM caddy:2.11-alpine AS caddy
+RUN setcap -r /usr/bin/caddy
+
+FROM alpine:3.24
ARG BUILD_VERSION=""
ARG SOURCE_SHA=""
@@ -24,6 +27,9 @@ LABEL org.opencontainers.image.revision="${SOURCE_SHA}"
LABEL org.opencontainers.image.created="${SOURCE_DATE}"
LABEL app.fluxer.build-version="${BUILD_VERSION}"
+RUN apk add --no-cache ca-certificates mailcap
+
+COPY --from=caddy /usr/bin/caddy /usr/bin/caddy
COPY fluxer_static/Caddyfile /etc/caddy/Caddyfile
COPY --chown=65532:65532 fluxer_static/LICENSE fluxer_static/THIRD_PARTY_LICENSES.md /srv/fluxer-static/
COPY --chown=65532:65532 fluxer_static/avatars /srv/fluxer-static/avatars
@@ -34,13 +40,18 @@ COPY --chown=65532:65532 fluxer_static/email /srv/fluxer-static/email
COPY --chown=65532:65532 fluxer_static/emoji /srv/fluxer-static/emoji
COPY --chown=65532:65532 fluxer_static/web /srv/fluxer-static/web
-RUN setcap -r /usr/bin/caddy \
- && mkdir -p /config/caddy /data/caddy \
+RUN mkdir -p /config/caddy /data/caddy \
&& chown -R 65532:65532 /config /data /srv/fluxer-static
+ENV XDG_CONFIG_HOME=/config
+ENV XDG_DATA_HOME=/data
+
USER 65532:65532
+WORKDIR /srv
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -q -O - http://127.0.0.1:8080/_health | grep -q OK
+
+CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]