fix(docker): use debian base image for correct MIME types
Docker Image bauen und veröffentlichen / docker (push) Successful in 23m3s
Docker Image bauen und veröffentlichen / docker (push) Successful in 23m3s
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.
This commit is contained in:
+10
-2
@@ -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
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /bin/nidusctl ./tools/nidusctl
|
||||||
|
|
||||||
# ---- Runtime stage ----
|
# ---- 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
|
WORKDIR /app
|
||||||
|
|
||||||
COPY --from=builder /bin/davserver /usr/local/bin/davserver
|
COPY --from=builder /bin/davserver /usr/local/bin/davserver
|
||||||
|
|||||||
Reference in New Issue
Block a user