2020-10-29 00:00:58 +08:00
|
|
|
FROM golang:alpine AS binarybuilder
|
|
|
|
RUN apk --no-cache --no-progress add \
|
2020-10-29 11:20:32 +08:00
|
|
|
gcc git musl-dev
|
2020-10-29 00:00:58 +08:00
|
|
|
WORKDIR /dashboard
|
|
|
|
COPY . .
|
2020-11-06 20:51:23 +08:00
|
|
|
RUN cd cmd/dashboard && go build -o app -ldflags="-s -w -X github.com/p14yground/nezha/service/dao.Version=$(git rev-parse HEAD)"
|
2020-10-29 00:14:31 +08:00
|
|
|
|
2020-10-29 00:00:58 +08:00
|
|
|
FROM alpine:latest
|
|
|
|
RUN apk --no-cache --no-progress add \
|
|
|
|
ca-certificates \
|
|
|
|
tzdata
|
|
|
|
WORKDIR /dashboard
|
2020-10-29 00:14:31 +08:00
|
|
|
COPY ./resource ./resource
|
2020-10-29 00:00:58 +08:00
|
|
|
COPY --from=binarybuilder /dashboard/cmd/dashboard/app ./app
|
|
|
|
|
|
|
|
VOLUME ["/dashboard/data"]
|
2020-11-06 20:51:23 +08:00
|
|
|
EXPOSE [3000, 5555]
|
|
|
|
CMD ["/dashboard/app"]
|