mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-09-20 18:20:12 +00:00
✨ 容器化部署
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
FROM golang:alpine AS binarybuilder
|
||||
RUN apk --no-cache --no-progress add \
|
||||
gcc git musl-dev
|
||||
WORKDIR /agent
|
||||
COPY . .
|
||||
RUN cd cmd/agent && 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 \
|
||||
ca-certificates \
|
||||
tzdata
|
||||
WORKDIR /agent
|
||||
COPY --from=binarybuilder /agent/cmd/agent/app ./app
|
||||
|
||||
ENV HOST_PROC /agent/host/proc
|
||||
ENV HOST_SYS /agent/host/sys
|
||||
ENV HOST_ETC /agent/host/etc
|
||||
ENV HOST_VAR /agent/host/var
|
||||
ENV HOST_RUN /agent/host/run
|
||||
ENV HOST_DEV /agent/host/dev
|
||||
|
||||
ENV DEBUG false #服务器使用IP时请设置为true
|
||||
|
||||
ENV [ID, SECRET, SERVER]
|
||||
|
||||
VOLUME ["/agent/host/proc", "/agent/host/sys", "/agent/host/etc", "/agent/host/var", "/agent/host/run", "/agent/host/dev"]
|
||||
CMD /agent/app -s $SERVER -i $ID -p $SECRET -d $DEBUG
|
||||
Reference in New Issue
Block a user