2021-12-04 09:25:54 +00:00
|
|
|
FROM golang:alpine as builder-base
|
2021-12-03 22:04:09 +00:00
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod /app/go.mod
|
|
|
|
COPY go.sum /app/go.sum
|
2021-12-08 14:18:54 +00:00
|
|
|
RUN go mod download -x
|
2021-12-03 22:04:09 +00:00
|
|
|
COPY . /app
|
2021-12-08 14:18:54 +00:00
|
|
|
RUN go build -o dist/ezshare main.go
|
2021-12-03 22:04:09 +00:00
|
|
|
|
|
|
|
FROM builder-base as cross-compiler
|
|
|
|
VOLUME ["/data"]
|
|
|
|
CMD ["/app/scripts/cross-compile.sh"]
|
|
|
|
|
|
|
|
FROM alpine:latest
|
2021-12-08 14:18:54 +00:00
|
|
|
COPY --from=builder-base /app/dist/ezshare /usr/bin/ezshare
|
2021-12-03 22:04:09 +00:00
|
|
|
EXPOSE 50051
|
|
|
|
EXPOSE 8088
|
2021-12-04 02:39:14 +00:00
|
|
|
CMD ["/usr/bin/ezshare", "--config", "/data/ezshare.toml", "serve"]
|