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

13 lines
288 B
Docker

FROM golang:1.16-alpine AS backend
WORKDIR /go/src/app
COPY go.* .
COPY internal ./internal
RUN go mod download
COPY cmd/backend .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-s' -o backend .
FROM scratch
COPY --from=backend /go/src/app/backend /backend
EXPOSE 8080
CMD ["/backend"]