From 695da7ea87d2b455552b709d3cb4d7879484d4d1 Mon Sep 17 00:00:00 2001 From: cgcel Date: Thu, 10 Nov 2022 14:13:34 +0800 Subject: [PATCH] feat: support docker compose (#54) --- README.md | 26 ++++++++++++++++++++++++++ README_zh-CN.md | 26 ++++++++++++++++++++++++++ docker-compose.yml | 11 +++++++++++ 3 files changed, 63 insertions(+) create mode 100644 docker-compose.yml diff --git a/README.md b/README.md index aa46158a..8a78037b 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,36 @@ go install github.com/monkeyWie/gopeed/cmd/gopeed ### Docker +#### Start directly + ```bash docker run -d -p 9999:9999 -v /path/to/download:/download liwei2633/gopeed ``` +#### Using Docker Compose + +```yaml +version: '3' + +services: + gopeed: + container_name: gopeed + ports: + - 9999:9999 + image: liwei2633/gopeed + volumes: + - ~/Downloads:/download + restart: unless-stopped +``` + +Use the command below to start container: + +```bash +docker compose up -d +``` + +#### Access Gopeed + When the docker container is running, you can access the web page through `http://localhost:9999`. > Tip: Modify the download path to `/download` on the setting page to access the downloaded files on the host. diff --git a/README_zh-CN.md b/README_zh-CN.md index 807ac9e0..3052a382 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -37,10 +37,36 @@ go install github.com/monkeyWie/gopeed/cmd/gopeed ### Docker +#### 直接运行 + ```bash docker run -d -p 9999:9999 -v /path/to/download:/download liwei2633/gopeed ``` +#### 使用 Docker Compose + +```yaml +version: '3' + +services: + gopeed: + container_name: gopeed + ports: + - 9999:9999 + image: liwei2633/gopeed + volumes: + - ~/Downloads:/download + restart: unless-stopped +``` + +输入以下指令启动容器: + +```bash +docker compose up -d +``` + +#### 访问服务 + 当 docker 容器运行时,可以通过 `http://localhost:9999` 访问 web 页面。 > 提示:在设置页面把下载路径修改为 `/download` 以便在宿主机访问下载完的文件。 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..cacd2654 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +version: '3' + +services: + gopeed: + container_name: gopeed + ports: + - 9999:9999 # HTTP port (host:container) + image: liwei2633/gopeed + volumes: + - ~/Downloads:/download # replace with your prefer path + restart: unless-stopped