mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 20:58:14 -05:00
19 lines
514 B
Docker
19 lines
514 B
Docker
FROM golang:alpine AS binarybuilder
|
|
RUN apk --no-cache --no-progress add \
|
|
gcc git musl-dev
|
|
WORKDIR /dashboard
|
|
COPY . .
|
|
RUN cd cmd/dashboard && go build -o app -ldflags="-s -w -X github.com/naiba/nezha/service/dao.Version=$(git rev-parse HEAD)"
|
|
|
|
FROM alpine:latest
|
|
RUN apk --no-cache --no-progress add \
|
|
ca-certificates \
|
|
tzdata
|
|
WORKDIR /dashboard
|
|
COPY ./resource ./resource
|
|
COPY --from=binarybuilder /dashboard/cmd/dashboard/app ./app
|
|
|
|
VOLUME ["/dashboard/data"]
|
|
EXPOSE 80 5555
|
|
CMD ["/dashboard/app"]
|