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

Updated Go version in Dockerfile and go.mod to ensure better compatibility and unpinned the Go version in Dockerfile for increased flexibility. Multiple dependencies in go.mod and go.sum have been updated to their newer versions for improved functionality and security. This will keep the project up-to-date with the latest features and bug fixes offered by these dependencies. Removed unused dependencies to keep the project clean and efficient.
17 lines
465 B
Docker
17 lines
465 B
Docker
# Build go
|
|
FROM golang:1.21.4-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"] |