Skip to content

Commit

Permalink
Merge pull request #21 from Ilhasoft/update-dockerfile
Browse files Browse the repository at this point in the history
update dockerfile for build with go 1.19 and use multistage build
  • Loading branch information
rasoro authored Nov 28, 2024
2 parents a2639f7 + 97c30b6 commit e68fe17
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
FROM golang:1.17.3-alpine3.14
FROM golang:1.19-alpine3.18 AS builder

WORKDIR /app

RUN apk update \
&& apk add --virtual build-deps gcc git \
&& rm -rf /var/cache/apk/*

RUN addgroup -S golang \
&& adduser -S -G golang golang

COPY . .

RUN go install -v ./cmd/...
RUN chown -R golang /app
RUN --mount=type=cache,target=/go/pkg/mod/ \
go install -v ./cmd/...

FROM alpine:3.18

USER golang
COPY --from=builder /go/bin/ /app/

WORKDIR /app

EXPOSE 8080
ENTRYPOINT ["rp-archiver"]
ENTRYPOINT ["./rp-archiver"]

0 comments on commit e68fe17

Please sign in to comment.