ezshare/Dockerfile

18 lines
417 B
Docker

FROM golang:alpine as builder-base
WORKDIR /app
COPY go.mod /app/go.mod
COPY go.sum /app/go.sum
RUN go mod download -x
COPY . /app
RUN go build -o dist/ezshare main.go
FROM builder-base as cross-compiler
VOLUME ["/data"]
CMD ["/app/scripts/cross-compile.sh"]
FROM alpine:latest
VOLUME [ "/data" ]
COPY --from=builder-base /app/dist/ezshare /usr/bin/ezshare
EXPOSE 50051
EXPOSE 8088
CMD ["/usr/bin/ezshare", "serve"]