From 88543a67eb78c783ce7d6e69422233d2c7a8010e Mon Sep 17 00:00:00 2001 From: arnef Date: Tue, 8 Sep 2026 21:38:19 +0200 Subject: [PATCH] fix(docker): use debian base image for correct MIME types Alpine lacks shared-mime-info, so file extensions with no built-in Go mime type (ODF, OOXML, epub, ics, ...) fall back to content sniffing and are served as "application/zip", breaking Collabora/DAVx5 on Android. Switch to debian:bookworm-slim and install shared-mime-info. Also install wget for the /healthz healthcheck instead of curl. --- Dockerfile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d15c174..63667ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,9 +10,17 @@ RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /bin/davserver ./cmd/s RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /bin/nidusctl ./tools/nidusctl # ---- Runtime stage ---- -FROM alpine:3.19 +FROM debian:bookworm-slim -RUN apk add --no-cache ca-certificates tzdata +# shared-mime-info: the OS MIME database (/usr/share/mime/globs2) that Go's +# mime.TypeByExtension consults. Without it, file extensions with no built-in +# Go type (ODF/.ods, OOXML/.docx, ebook/.epub, calendar/.ics, ...) fall back +# to content sniffing and are served as "application/zip", which breaks +# Collabora/DAVx5 on Android. wget: used by the /healthz healthcheck. +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates tzdata wget shared-mime-info \ + && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY --from=builder /bin/davserver /usr/local/bin/davserver