From 65da5346bb284f530444094f8bdaaaf4d7f8f4f3 Mon Sep 17 00:00:00 2001 From: Finn Date: Sun, 31 Mar 2024 22:47:00 -0700 Subject: [PATCH] Add ca-certificates to container, slightly improve logging --- Containerfile | 2 ++ serve.go | 1 + 2 files changed, 3 insertions(+) diff --git a/Containerfile b/Containerfile index 0a4b49f..008b4c8 100644 --- a/Containerfile +++ b/Containerfile @@ -1,8 +1,10 @@ FROM library/golang:1.21 AS build +RUN apt-get update && apt-get install -y ca-certificates && mkdir -p /tmp/etc/ssl/certs && cp /etc/ssl/certs/ca-certificates.crt /tmp/etc/ssl/certs/ca-certificates.crt ADD . /go/s3staticsite WORKDIR /go/s3staticsite RUN CGO_ENABLED=0 go build . FROM scratch +COPY --from=build /tmp/etc /etc COPY --from=build /go/s3staticsite/s3staticsite /s3staticsite ENTRYPOINT ["/s3staticsite"] diff --git a/serve.go b/serve.go index 4702bd3..ec73a71 100644 --- a/serve.go +++ b/serve.go @@ -45,6 +45,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } + slog.Warn("failed to stat object", "err", err, "bucket", domain, "path", path) http.Error(w, err.Error(), http.StatusInternalServerError) return }