Skip to content

Commit

Permalink
update dockerfile and workflow build
Browse files Browse the repository at this point in the history
  • Loading branch information
rasoro committed Dec 6, 2024
1 parent cdb159e commit 595884d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
20 changes: 9 additions & 11 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 595884d

Please sign in to comment.