1
0
mirror of https://github.com/ebosas/microservices.git synced 2025-07-06 22:35:52 +02:00
Files
microservices/backend.Dockerfile

13 lines
334 B
Docker
Raw Normal View History

2021-06-01 14:26:02 +03:00
FROM golang:1.16-alpine AS backend
WORKDIR /go/src/app
COPY backend/go.mod backend/go.sum ./
RUN go mod download
COPY backend .
# Info about flags: https://golang.org/cmd/link/
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"]