添加docker-compose支持 (#73)

* Create docker-compose.yaml

添加一键启动脚本,sample容器完成自动拉github.com上的源码,一旦拉取正常完成,就自动退出
build镜像就是要使用源码的容器。

* Update README.md

添加docker-compose说明

Co-authored-by: 老九 <366193849@qq.com>
This commit is contained in:
slcnx 2021-11-08 19:16:54 +08:00 committed by GitHub
parent fc23e0324d
commit 1915aa0ad7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 1 deletions

View File

@ -22,7 +22,12 @@ github加速神器解决github打不开、用户头像无法加载、releases
* 安装cacert/fastgithub.cer并设置信任
* 设置系统自动代理为`http://127.0.0.1:38457`或手动代理http/https为`127.0.0.1:38457`
* [具体配置详情](https://github.com/dotnetcore/FastGithub/blob/master/MacOSXConfig.md)
#### 2.4 docker-compose一键部署
* 准备好docker 18.09, docker-compose.
* 在源码目录下有一个docker-compose.yaml 文件专用于在实际项目中临时使用github.com源码而做的demo配置。
* 根据自己的需要更新docker-compose.yaml中的sample和build镜像即可完成拉github.com源码加速并基于源码做后续的操作。
### 3 软件功能
* 提供域名的纯净IP解析
* 提供IP测速并选择最快的IP

34
docker-compose.yaml Normal file
View File

@ -0,0 +1,34 @@
version: "3.7"
services:
fastgithub:
image: slcnx/fastgithub
network_mode: host
restart: always
volumes:
- cacert:/fastgithub/cacert/
sample:
depends_on:
- fastgithub
image: slcnx/ubuntu:18.04
volumes:
- cacert:/tmp/cacert
- build_data:/build_data
working_dir: /build_data
restart: on-failure
tty: true
entrypoint: sh -c 'cp /tmp/cacert/fastgithub.cer /usr/local/share/ca-certificates/fastgithub.crt && update-ca-certificates && git clone https://github.com/kubernetes/kubernetes.git'
command: ""
environment:
https_proxy: http://127.0.0.1:38457
http_proxy: http://127.0.0.1:38457
network_mode: host
build:
working_dir: /build_data
depends_on:
- sample
image: nginx
volumes:
- build_data:/build_data
volumes:
cacert: {}
build_data: {}