-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM arm64v8/golang:1.22-alpine3.19 as builder | ||
|
||
RUN set -eux; \ | ||
apk add --no-cache git gcc build-base sqlite-dev npm nodejs; \ | ||
git clone https://github.com/lejianwen/rustdesk-api-web; \ | ||
git clone https://github.com/lejianwen/rustdesk-api; \ | ||
#先编译后台 | ||
cd rustdesk-api-web; \ | ||
npm install; \ | ||
npm run build; \ | ||
cd ..; \ | ||
mkdir -p rustdesk-api/resources/admin; \ | ||
cp -ar rustdesk-api-web/dist/* rustdesk-api/resources/admin; \ | ||
cd rustdesk-api; \ | ||
go mod tidy; \ | ||
go install github.com/swaggo/swag/cmd/swag@latest; \ | ||
swag init -g cmd/apimain.go --output docs/api --instanceName api --exclude http/controller/admin; \ | ||
swag init -g cmd/apimain.go --output docs/admin --instanceName admin --exclude http/controller/api; \ | ||
go env -w GO111MODULE=on;\ | ||
CGO_LDFLAGS="-static" CGO_ENABLED=1 GOARCH=arm64 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go; \ | ||
cp -ar resources release/; \ | ||
mkdir -p release/resources/public; \ | ||
cp -ar docs release/; \ | ||
cp -ar conf release/; \ | ||
mkdir -p release/data; \ | ||
mkdir -p release/runtime; | ||
|
||
|
||
FROM arm64v8/alpine | ||
WORKDIR /app | ||
RUN apk add --no-cache tzdata | ||
COPY --from=builder /go/rustdesk-api/release /app/ | ||
VOLUME /app/data | ||
|
||
EXPOSE 21114 | ||
CMD ["./apimain"] |