Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

我提供了类似 xray 的 docker-compose 部署方式 #22

Open
shizeying opened this issue Oct 19, 2023 · 2 comments
Open

我提供了类似 xray 的 docker-compose 部署方式 #22

shizeying opened this issue Oct 19, 2023 · 2 comments

Comments

@shizeying
Copy link

# Build go
FROM golang:1.21-alpine AS builder
WORKDIR /app
ENV CGO_ENABLED=0
ENV version=v3.0.0
RUN  apk --update --no-cache add tzdata ca-certificates git
RUN  git clone https://github.com/InazumaV/V2bX.git . &&git checkout v3.0.0 && \
     go build -v -o V2bX -tags "sing xray with_reality_server with_quic" -trimpath -ldflags "-X 'github.com/InazumaV/V2bX/cmd.version=$version' -s -w -buildid="


# Release
FROM  alpine
# 安装必要的工具包
RUN  apk --update --no-cache add tzdata ca-certificates git \
    && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN mkdir /etc/V2bX
COPY --from=builder /app/V2bX /usr/local/bin
COPY --from=builder /app/example /etc/V2bX
RUN  mv /etc/V2bX/config.json /etc/V2bX/config.json

ENTRYPOINT [ "V2bX", "server"]
~                               

提供的 yml

version: '3.8'
services:
  xrayr:
    build:
      context: ./
      dockerfile: Dockerfile
    volumes:
      - ./config:/etc/V2bX # 映射配置文件夹
    restart: always
    network_mode: host
@shizeying
Copy link
Author

我觉得无需列出,上面已经写的很清楚,当你使用 docekr-compose 部署的时候,那么会触发自动编译.这本身并不冲突

@alexallen1
Copy link

alexallen1 commented Apr 24, 2024

感谢分享~ 能否再做一个docker-compose ,https://github.com/wyx2685/V2bX-script 这家的~
他有hy2和xray魔改支持

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants