Skip to content

Commit

Permalink
Modify the restart policy of docker to unless-stopped (#295)
Browse files Browse the repository at this point in the history
* “完善宝塔面板反向代理教程”

* update reverse-proxy.md

* Update reverse-proxy.md

修正图片路径

* Update reverse-proxy.md

* Update bt_reverse_proxy.png

* 新增docker-compose.yml

修改重启策略为unless-stopped

* Revert "新增docker-compose.yml"

This reverts commit 3785e79.

* Modify the restart policy to 'unless-stopped'

Added a new docker-compose.yml

---------

Co-authored-by: hiqz <cncpu@qq.com>
Co-authored-by: troray <binghe27@gmail.com>
  • Loading branch information
3 people authored Jan 6, 2024
1 parent 980346b commit 70364e0
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 16 deletions.
14 changes: 14 additions & 0 deletions docs/.vuepress/public/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.3'
services:
alist:
image: 'xhofe/alist:latest'
container_name: alist
volumes:
- './:/opt/alist/data'
ports:
- '5244:5244'
environment:
- PUID=0
- PGID=0
- UMASK=022
restart: unless-stopped
25 changes: 17 additions & 8 deletions docs/guide/install/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,26 @@ docker exec -it alist ./alist admin set NEW_PASSWORD
#### **docker-cli**

```bash
docker run -d --restart=always -v /etc/alist:/opt/alist/data -p 5244:5244 -e PUID=0 -e PGID=0 -e UMASK=022 --name="alist" xhofe/alist:latest
docker run -d --restart=unless-stopped -v /etc/alist:/opt/alist/data -p 5244:5244 -e PUID=0 -e PGID=0 -e UMASK=022 --name="alist" xhofe/alist:latest
```

#### **docker-compose**

```bash
mkdir /etc/alist
cd /etc/alist
wget https://alist.nn.ci/docker-compose.yml
docker-compose up -d
```

**Alternatively, you can manually create a `docker-compose.yml` file with the following content.**

```yaml
version: '3.3'
services:
alist:
restart: always
image: 'xhofe/alist:latest'
container_name: alist
volumes:
- '/etc/alist:/opt/alist/data'
ports:
Expand All @@ -60,8 +70,7 @@ services:
- PUID=0
- PGID=0
- UMASK=022
container_name: alist
image: 'xhofe/alist:latest'
restart: unless-stopped
```
### **Offline download with aria2**
Expand All @@ -74,7 +83,7 @@ Just for amd64/arm64. Not recommended, this may can't work properly.
#### **docker-cli**
```bash
docker run -d --restart=always -v /etc/alist:/opt/alist/data -p 5244:5244 -e PUID=0 -e PGID=0 -e UMASK=022 --name="alist" xhofe/alist:main
docker run -d --restart=unless-stopped -v /etc/alist:/opt/alist/data -p 5244:5244 -e PUID=0 -e PGID=0 -e UMASK=022 --name="alist" xhofe/alist:main
```

#### **docker-compose**
Expand All @@ -83,7 +92,8 @@ docker run -d --restart=always -v /etc/alist:/opt/alist/data -p 5244:5244 -e PUI
version: '3.3'
services:
alist:
restart: always
image: 'xhofe/alist:main'
container_name: alist
volumes:
- '/etc/alist:/opt/alist/data'
ports:
Expand All @@ -92,8 +102,7 @@ services:
- PUID=0
- PGID=0
- UMASK=022
container_name: alist
image: 'xhofe/alist:main'
restart: unless-stopped
```
### **Specify version**
Expand Down
30 changes: 22 additions & 8 deletions docs/zh/guide/install/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,16 @@ docker exec -it alist ./alist admin set NEW_PASSWORD
##### **docker-cli**

```bash
docker run -d --restart=always -v /etc/alist:/opt/alist/data -p 5244:5244 -e PUID=0 -e PGID=0 -e UMASK=022 --name="alist" xhofe/alist:latest
docker run -d --restart=unless-stopped -v /etc/alist:/opt/alist/data -p 5244:5244 -e PUID=0 -e PGID=0 -e UMASK=022 --name="alist" xhofe/alist:latest
```

##### **docker-compose**
```yaml
version: '3.3'
services:
alist:
restart: always
image: 'xhofe/alist:latest'
container_name: alist
volumes:
- '/etc/alist:/opt/alist/data'
ports:
Expand All @@ -60,8 +61,7 @@ services:
- PUID=0
- PGID=0
- UMASK=022
container_name: alist
image: 'xhofe/alist:latest'
restart: unless-stopped
```
### **使用 aria2 离线下载**
Expand All @@ -75,15 +75,30 @@ services:
##### **docker-cli**
```bash
docker run -d --restart=always -v /etc/alist:/opt/alist/data -p 5244:5244 -e PUID=0 -e PGID=0 -e UMASK=022 --name="alist" xhofe/alist:main
docker run -d --restart=unless-stopped -v /etc/alist:/opt/alist/data -p 5244:5244 -e PUID=0 -e PGID=0 -e UMASK=022 --name="alist" xhofe/alist:main
```

##### **docker-compose**

```bash
#创建一个目录
mkdir /etc/alist
#进入该目录
cd /etc/alist
#下载docker-compose.yml文件
wget https://alist.nn.ci/docker-compose.yml
#运行容器
docker-compose up -d
```

**你也可以自行创建一个包含以下内容的`docker-compose.yml`文件**

```yaml
version: '3.3'
services:
alist:
restart: always
image: 'xhofe/alist:main'
container_name: alist
volumes:
- '/etc/alist:/opt/alist/data'
ports:
Expand All @@ -92,8 +107,7 @@ services:
- PUID=0
- PGID=0
- UMASK=022
container_name: alist
image: 'xhofe/alist:main'
restart: unless-stopped
```
### **指定版本**
Expand Down

0 comments on commit 70364e0

Please sign in to comment.