mirror of
https://github.com/XrayR-project/XrayR.git
synced 2025-06-07 21:09:53 +00:00

Reorganized the Go package structure, moving the main package to 'cmd'. Upgraded the flag library to Cobra for better management of CLI commands. This included moving the X25519 key generation from a flag to its own standalone Cobra command, which improves user interaction and code modularity. This structural change will benefit future additions and code maintainability.
17 lines
463 B
Docker
17 lines
463 B
Docker
# Build go
|
|
FROM golang:1.21-alpine AS builder
|
|
WORKDIR /app
|
|
COPY . .
|
|
ENV CGO_ENABLED=0
|
|
RUN go mod download
|
|
RUN go build -v -o XrayR -trimpath -ldflags "-s -w -buildid="
|
|
|
|
# Release
|
|
FROM alpine
|
|
# 安装必要的工具包
|
|
RUN apk --update --no-cache add tzdata ca-certificates \
|
|
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
|
RUN mkdir /etc/XrayR/
|
|
COPY --from=builder /app/XrayR /usr/local/bin
|
|
|
|
ENTRYPOINT [ "XrayR", "--config", "/etc/XrayR/config.yml"] |