Skip to content

Commit

Permalink
增加docker-compose,更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
hslr-s committed Dec 31, 2023
1 parent 534a59c commit 4c7d08c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
31 changes: 25 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Sun-Proxy
一个简单的反向代理程序, 为 [sun-panel](https://github.com/hslr-s/sun-panel)插件打造
一个简单的反向代理程序, 为 [sun-panel](https://github.com/hslr-s/sun-panel) 插件打造

### TODO
DockerHub地址:https://hub.docker.com/r/hslr/sun-proxy

## TODO

- [x] 自动填入目标站的basic信息
- [x] 给代理站增加basic验证
Expand All @@ -14,7 +16,7 @@
- [ ] 网址内容替换


### 目前已经实现4种模式:
## 目前已经实现4种模式:

域名 => 域名
calendar.cn:8080 => http://192.168.3.100
Expand All @@ -29,7 +31,7 @@ calendar.cn:8080 => http://192.168.3.100
127.0.0.1:8080/sun-panel-tool-page => http://localhost:1003/sun-panel-tool-page


### 命令说明
## 命令说明

```
-c string
Expand All @@ -38,9 +40,15 @@ calendar.cn:8080 => http://192.168.3.100
generate sample configuration file 生成示例配置文件
```

执行示例:

```sh
./sun-proxy -c ./sun-proxy.yml
```

### 配置文件示例
## 配置文件

一个完整的示例 `./sun-proxy.yml`
```yml
name: Sun-Proxy
port:
Expand All @@ -67,7 +75,7 @@ rules:
123456
```
### docker
## docker 运行
|参数|示例|说明|
|---|---|---|
Expand All @@ -92,4 +100,15 @@ hslr/sun-proxy
构建:
```
docker build -t hslr/sun-proxy .
```

## docker compose运行
查看[docker-compose.yml](docker-compose.yml)

```sh
# start
./docker-compose up -d

# close
./docker-compose down
```
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3.2"

services:
sun-proxy:
image: 'hslr/sun-proxy:latest'
container_name: sun-proxy
volumes:
- ./sun-proxy.yml:/app/sun-proxy.yml
- ./cert:/app/cert
ports:
- 8080:8080 # http
- 8081:8081 # https
restart: always
command: ['./sun-proxy', '-c', './sun-proxy.yml']

0 comments on commit 4c7d08c

Please sign in to comment.