容器化部署

This commit is contained in:
naiba
2020-11-06 20:51:23 +08:00
parent fc1e15bf31
commit b46216fe5d
6 changed files with 377 additions and 37 deletions

View File

@@ -3,8 +3,7 @@ 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/p14yground/nezha/service/dao.Version=`git rev-parse HEAD`"
RUN cd cmd/dashboard && go build -o app -ldflags="-s -w -X github.com/p14yground/nezha/service/dao.Version=$(git rev-parse HEAD)"
FROM alpine:latest
RUN apk --no-cache --no-progress add \
@@ -15,5 +14,5 @@ COPY ./resource ./resource
COPY --from=binarybuilder /dashboard/cmd/dashboard/app ./app
VOLUME ["/dashboard/data"]
EXPOSE 3000
CMD ["/dashboard/app"]
EXPOSE [3000, 5555]
CMD ["/dashboard/app"]