nezha/Dockerfile.dashboard

20 lines
450 B
Docker
Raw Normal View History

2020-10-29 00:00:58 +08:00
FROM golang:alpine AS binarybuilder
RUN apk --no-cache --no-progress add \
gcc \
musl-dev
WORKDIR /dashboard
COPY . .
RUN cd cmd/dashboard \
&& go build -o app -ldflags="-s -w"
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"]
EXPOSE 3000
CMD ["/dashboard/app"]