Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
NikPoliakov authored Oct 3, 2023
1 parent 77d3bc5 commit 5bbae15
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Build stage
FROM golang AS build-env
FROM golang:1.18-alpine As build-env

RUN mkdir /src
WORKDIR /src
COPY go.mod .
COPY go.sum .

# Get dependancies - will also be cached if we won't change mod/sum
RUN go mod download

# COPY the source code as the last step
COPY . .

RUN go mod download google.golang.org/grpc/cmd/protoc-gen-go-grpc
RUN go get github.com/grpc-ecosystem/grpc-gateway/v2/[email protected]

RUN apk add make
RUN make install
RUN make generate

ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64
RUN go build -a -installsuffix cgo -o /api

# Production stage
FROM scratch
# # Production stage
FROM golang:1.18-alpine
COPY --from=build-env /api /

EXPOSE 10000
Expand Down

0 comments on commit 5bbae15

Please sign in to comment.