forked from mtusi2026/mtusi2026lab4
feat: restricted S3 credentials, orphan reconciler, upload limits (grade 4)
This commit is contained in:
+6
-3
@@ -4,16 +4,19 @@ COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY cmd ./cmd
|
||||
COPY internal ./internal
|
||||
RUN CGO_ENABLED=0 go build -trimpath -o /out/server ./cmd/server
|
||||
RUN CGO_ENABLED=0 go build -trimpath -o /out/server ./cmd/server \
|
||||
&& CGO_ENABLED=0 go build -trimpath -o /out/s3-init ./cmd/s3-init \
|
||||
&& CGO_ENABLED=0 go build -trimpath -o /out/reconcile ./cmd/reconcile \
|
||||
&& CGO_ENABLED=0 go build -trimpath -o /out/s3tool ./cmd/s3tool
|
||||
|
||||
FROM alpine:3.24.1
|
||||
ARG BUILD_ID=dev
|
||||
LABEL org.opencontainers.image.revision=$BUILD_ID
|
||||
RUN adduser -D -H -u 10001 app
|
||||
COPY --from=build /out/server /usr/local/bin/server
|
||||
COPY --from=build /out/server /out/s3-init /out/reconcile /out/s3tool /usr/local/bin/
|
||||
USER app
|
||||
ENV APP_HOST=0.0.0.0 APP_PORT=8080
|
||||
EXPOSE 8080
|
||||
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD wget -q -O /dev/null "http://127.0.0.1:${APP_PORT}/health/ready" || exit 1
|
||||
ENTRYPOINT ["/usr/local/bin/server"]
|
||||
ENTRYPOINT ["/usr/local/bin/server"]
|
||||
Reference in New Issue
Block a user