Skip to content

Commit

Permalink
distroless container
Browse files Browse the repository at this point in the history
  • Loading branch information
kiberdruzhinnik committed Mar 4, 2024
1 parent 8859b53 commit 5ef4731
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ COPY . ./
RUN go build -ldflags "-s -w" -o go-exchange-api cmd/go-exchange-api/main.go
RUN go build -ldflags "-s -w" -o healthcheck cmd/healthcheck/main.go

FROM alpine
FROM gcr.io/distroless/base-debian12:nonroot
ENV GIN_MODE release
WORKDIR /app
COPY --from=builder /src/app/go-exchange-api ./go-exchange-api
COPY --from=builder /src/app/healthcheck ./healthcheck
RUN apk update && \
addgroup -S appgroup && \
adduser -S appuser -G appgroup
USER appuser
HEALTHCHECK --interval=30s --timeout=10s --retries=3 CMD ["./healthcheck"]
ENTRYPOINT ["./go-exchange-api"]

0 comments on commit 5ef4731

Please sign in to comment.