Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
AirportR committed Dec 5, 2023
2 parents aedb14b + 934957a commit 7cf799c
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 11 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ci

on:
push:
branches:
- "dev"

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Environment Variables
run: |
IMG=fulltclash
OWNER="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
echo "IMG=${IMG}" >> $GITHUB_ENV
echo "IMAGE=ghcr.io/${OWNER}/${IMG}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: .
file: ./docker/Dockerfile
push: true
tags: |
${{ env.IMAGE }}:latest
${{ env.IMAGE }}:dev
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ fulltclash-windows-amd64 为 Windows-amd64 所支持的

编译完成覆盖原文件即可 ,如果操作难度太大,可以发起issue详谈。
### Docker启动
教程文档待更新
[./docker/ 目录](https://github.com/AirportR/FullTclash/tree/dev/docker)
### 为程序设置进程守护(Linux)
由于Linux系统特性,关闭ssh连接后,前台程序会被关闭。您需要设置进程守护,才能在后台不间断地运行程序。具体方法Google搜索即可。
## 交流探讨
Expand Down
31 changes: 21 additions & 10 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,33 @@ clash:
branch: meta
```

## 构建Docker镜像
## 部署

### 下载Dockerfile
```
wget -N https://raw.githubusercontent.com/AirportR/FullTclash/dev/docker/Dockerfile
```

### 构建镜像
### 拉取镜像
```
docker build -t fulltclash:dev .
docker pull ghcr.io/airportr/fulltclash:dev
```

启动
### docker
```bash
docker run -itd --name=fulltclash --restart=always -v /etc/FullTclash/config.yaml:/app/resources/config.yaml ghcr.io/airportr/fulltclash:dev
```
docker run -itd --name=fulltclash --restart=always -v /etc/FullTclash/config.yaml:/app/resources/config.yaml fulltclash:dev

### docker-compose

```bash
# 安装 docker-compose
# curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
# chmod +x /usr/local/bin/docker-compose
wget -N https://raw.githubusercontent.com/AirportR/FullTclash/dev/docker/docker-compose.yml

# 启动
docker-compose up -d
# 停止
docker-compose down
```

查看日志
```
docker exec -it fulltclash tail -f /var/log/fulltclash.log
Expand All @@ -48,4 +59,4 @@ docker exec -it fulltclash bash /app/docker/update.sh
重启程序
```
docker exec -it fulltclash supervisorctl restart fulltclash
```
```
9 changes: 9 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '3.9'

services:
fulltclash:
image: ghcr.io/airportr/fulltclash:dev
restart: always
container_name: fulltclash
volumes:
- /etc/FullTclash/config.yaml:/app/resources/config.yaml
1 change: 1 addition & 0 deletions docker/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ if [[ $last_version == "$git_version" ]]; then
else
echo -e "检查到新版本,正在更新"
update
supervisorctl restart fulltclash
fi

0 comments on commit 7cf799c

Please sign in to comment.