diff --git a/.github/workflows/build-rp-archiver-push-tag-india-ire.yaml b/.github/workflows/build-rp-archiver-push-tag-india-ire.yaml index e39e26f..6728a2f 100644 --- a/.github/workflows/build-rp-archiver-push-tag-india-ire.yaml +++ b/.github/workflows/build-rp-archiver-push-tag-india-ire.yaml @@ -16,7 +16,6 @@ jobs: if grep -qs -e '^.*.*-develop' <<< "${TAG}" ; then echo "Found environment: DEVELOP - ${TAG}" echo "ENVIRONMENT=develop" | tee -a "${GITHUB_ENV}" - exit 1 # stop action elif grep -qs -e '^.*.*-staging' <<< "${TAG}" ; then echo "Found environment: STAGING - ${TAG}" echo "ENVIRONMENT=staging" | tee -a "${GITHUB_ENV}" diff --git a/docker/Dockerfile b/docker/Dockerfile index c4f1fb2..cd5c4c9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,21 +1,19 @@ -FROM golang:1.19-alpine3.18 AS builder +FROM golang:1.23-bookworm AS builder -WORKDIR /app - -RUN apk update \ - && apk add --virtual build-deps gcc git \ - && rm -rf /var/cache/apk/* +WORKDIR /src -COPY . . +COPY go.mod go.sum ./ +RUN go mod download -x -RUN --mount=type=cache,target=/go/pkg/mod/ \ - go install -v ./cmd/... +COPY . ./ -FROM alpine:3.18 +RUN GOOS=linux GOARCH=amd64 go build -o /bin/rp-archiver ./cmd/rp-archiver/*.go -COPY --from=builder /go/bin/ /app/ +FROM gcr.io/distroless/base-debian12 WORKDIR /app +COPY --from=builder bin/rp-archiver ./ + EXPOSE 8080 ENTRYPOINT ["./rp-archiver"]