1
0
mirror of https://github.com/ebosas/microservices.git synced 2024-11-24 08:02:24 +02:00
microservices/backend.Dockerfile

12 lines
276 B
Docker
Raw Normal View History

2021-10-11 12:32:47 +02:00
FROM golang:1.17-alpine AS backend
2021-06-01 13:26:02 +02:00
WORKDIR /go/src/app
2021-06-08 20:26:14 +02:00
COPY go.* .
COPY internal ./internal
2021-06-01 13:26:02 +02:00
RUN go mod download
2021-06-08 20:26:14 +02:00
COPY cmd/backend .
2021-06-01 13:26:02 +02:00
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-s' -o backend .
FROM scratch
COPY --from=backend /go/src/app/backend /backend
CMD ["/backend"]