Add ca-certificates to container, slightly improve logging
All checks were successful
/ build-container (push) Successful in 1m14s
All checks were successful
/ build-container (push) Successful in 1m14s
This commit is contained in:
parent
06ab2e9215
commit
65da5346bb
2 changed files with 3 additions and 0 deletions
|
@ -1,8 +1,10 @@
|
||||||
FROM library/golang:1.21 AS build
|
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
|
ADD . /go/s3staticsite
|
||||||
WORKDIR /go/s3staticsite
|
WORKDIR /go/s3staticsite
|
||||||
RUN CGO_ENABLED=0 go build .
|
RUN CGO_ENABLED=0 go build .
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
COPY --from=build /tmp/etc /etc
|
||||||
COPY --from=build /go/s3staticsite/s3staticsite /s3staticsite
|
COPY --from=build /go/s3staticsite/s3staticsite /s3staticsite
|
||||||
ENTRYPOINT ["/s3staticsite"]
|
ENTRYPOINT ["/s3staticsite"]
|
||||||
|
|
1
serve.go
1
serve.go
|
@ -45,6 +45,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
slog.Warn("failed to stat object", "err", err, "bucket", domain, "path", path)
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue