2023-12-17 01:01:08 -05:00
|
|
|
# Build go
|
2024-10-06 05:13:16 -04:00
|
|
|
FROM golang:1.23.2-alpine AS builder
|
2023-12-17 01:01:08 -05:00
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
|
|
ENV CGO_ENABLED=0
|
|
|
|
RUN go mod download
|
2024-02-08 00:52:37 -05:00
|
|
|
RUN go build -v -o V2bX -tags "sing xray hysteria2 with_reality_server with_quic with_grpc with_utls with_wireguard with_acme"
|
2023-12-17 01:01:08 -05:00
|
|
|
|
|
|
|
# Release
|
|
|
|
FROM alpine
|
|
|
|
# 安装必要的工具包
|
|
|
|
RUN apk --update --no-cache add tzdata ca-certificates \
|
|
|
|
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
|
|
|
RUN mkdir /etc/V2bX/
|
|
|
|
COPY --from=builder /app/V2bX /usr/local/bin
|
|
|
|
|
2023-12-18 00:36:22 -05:00
|
|
|
ENTRYPOINT [ "V2bX", "server", "--config", "/etc/V2bX/config.json"]
|