Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add docs for docker deployment #111

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ WORKDIR /

COPY --from=builder /go/bin/spoof-dpi .

EXPOSE 8080

ENTRYPOINT ["./spoof-dpi"]
14 changes: 13 additions & 1 deletion _docs/readme_zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,25 @@ $ go install github.com/xvzc/SpoofDPI/cmd/spoof-dpi@latest
```

## Git
You can also build your own
你可以从源码构建可执行文件
```bash
$ git clone https://github.com/xvzc/SpoofDPI.git
$ cd SpoofDPI
$ go build ./cmd/...
```

## Docker
你可以从Dockerfile构建你的docker image
```shell
docker build ./ -t spoof-dpi:latest
```
使用`docker run -it -p 8080:8080 --name spoof-dpi spoof-dpi:latest`运行容器
> 如果你希望在运行容器服务的时候传递参数(比如--enable-doh --timeout=2000), 你可以使用以下命令格式
```shell
docker run -it -p 8080:8080 spoof-dpi:latest --enable-doh
```
- 想要了解更多的参数, 请检查Usage部分内容

# 使用方法

```
Expand Down
12 changes: 12 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ $ cd SpoofDPI
$ go build ./cmd/...
```

## Docker
You can use Dockerfile to build a docker image
```shell
docker build ./ -t spoof-dpi:latest
```
Use `docker run -it -p 8080:8080 --name spoof-dpi spoof-dpi:latest` to run container
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we should show some other example that passes options through the docker run command like below

$ docker run -it -p 8080:8080 spoof-dpi:latest --enable-doh

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xvzc Better also add --name "..." and --rm to avoid generating a lot of garbage after each restart.
https://docs.docker.com/reference/cli/docker/container/run/#rm

> If you want to passes options(like --enable-doh --timeout=2000) through the docker, you can run command like below
```shell
docker run -it -p 8080:8080 spoof-dpi:latest --enable-doh
```
- check the Usage for more options

# Usage
```
Usage: spoof-dpi [options...]
Expand Down