Skip to content

Commit

Permalink
Change dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Robi9 committed Dec 6, 2024
1 parent e18b73f commit a5695c5
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
FROM golang:1.21.5-alpine
FROM golang:1.23-bookworm AS builder

WORKDIR /app
WORKDIR /src

COPY go.mod go.sum ./
RUN go mod download -x

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

RUN addgroup -S golang \
&& adduser -S -G golang golang
RUN GOOS=linux GOARCH=amd64 go build -o /bin/mailroom ./cmd/mailroom/*.go

COPY . .
FROM gcr.io/distroless/base-debian12

RUN go install -v ./cmd/...
RUN chown -R golang /app
WORKDIR /app

USER golang
COPY --from=builder bin/mailroom ./

EXPOSE 8080
ENTRYPOINT ["courier"]
EXPOSE 8090
ENTRYPOINT ["./courier"]

0 comments on commit a5695c5

Please sign in to comment.