14
Dockerfile
Normal file
14
Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
||||
FROM golang:latest AS builder
|
||||
WORKDIR /root
|
||||
COPY . .
|
||||
RUN go build main.go
|
||||
|
||||
|
||||
FROM debian:11-slim
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends -y ca-certificates \
|
||||
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
WORKDIR /root
|
||||
COPY --from=builder /root/main /root/x-ui
|
||||
COPY bin/. /root/bin/.
|
||||
VOLUME [ "/etc/x-ui" ]
|
||||
CMD [ "./x-ui" ]
|
||||
19
README.md
19
README.md
@@ -35,6 +35,25 @@ systemctl enable x-ui
|
||||
systemctl restart x-ui
|
||||
```
|
||||
|
||||
## 使用docker安装
|
||||
1. 安装docker
|
||||
```shell
|
||||
curl -fsSL https://get.docker.com | sh
|
||||
```
|
||||
2. 安装x-ui
|
||||
```shell
|
||||
mkdir x-ui && cd x-ui
|
||||
docker run -itd --network=host \
|
||||
-v $PWD/db/:/etc/x-ui/ \
|
||||
-v $PWD/cert/:/root/cert/ \
|
||||
--name x-ui --restart=unless-stopped \
|
||||
enwaiax/x-ui:latest
|
||||
```
|
||||
>Build 自己的镜像
|
||||
```shell
|
||||
docker build -t x-ui .
|
||||
```
|
||||
|
||||
## 建议系统
|
||||
- CentOS 7+
|
||||
- Ubuntu 16+
|
||||
|
||||
Reference in New Issue
Block a user