Skip to content

Commit 70364e0

Browse files
Troraycncpu
andauthored
Modify the restart policy of docker to unless-stopped (#295)
* “完善宝塔面板反向代理教程” * 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 <[email protected]> Co-authored-by: troray <[email protected]>
1 parent 980346b commit 70364e0

File tree

3 files changed

+53
-16
lines changed

3 files changed

+53
-16
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '3.3'
2+
services:
3+
alist:
4+
image: 'xhofe/alist:latest'
5+
container_name: alist
6+
volumes:
7+
- './:/opt/alist/data'
8+
ports:
9+
- '5244:5244'
10+
environment:
11+
- PUID=0
12+
- PGID=0
13+
- UMASK=022
14+
restart: unless-stopped

docs/guide/install/docker.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,26 @@ docker exec -it alist ./alist admin set NEW_PASSWORD
4242
#### **docker-cli**
4343

4444
```bash
45-
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
45+
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
4646
```
4747

4848
#### **docker-compose**
4949

50+
```bash
51+
mkdir /etc/alist
52+
cd /etc/alist
53+
wget https://alist.nn.ci/docker-compose.yml
54+
docker-compose up -d
55+
```
56+
57+
**Alternatively, you can manually create a `docker-compose.yml` file with the following content.**
58+
5059
```yaml
5160
version: '3.3'
5261
services:
5362
alist:
54-
restart: always
63+
image: 'xhofe/alist:latest'
64+
container_name: alist
5565
volumes:
5666
- '/etc/alist:/opt/alist/data'
5767
ports:
@@ -60,8 +70,7 @@ services:
6070
- PUID=0
6171
- PGID=0
6272
- UMASK=022
63-
container_name: alist
64-
image: 'xhofe/alist:latest'
73+
restart: unless-stopped
6574
```
6675
6776
### **Offline download with aria2**
@@ -74,7 +83,7 @@ Just for amd64/arm64. Not recommended, this may can't work properly.
7483
#### **docker-cli**
7584
7685
```bash
77-
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
86+
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
7887
```
7988

8089
#### **docker-compose**
@@ -83,7 +92,8 @@ docker run -d --restart=always -v /etc/alist:/opt/alist/data -p 5244:5244 -e PUI
8392
version: '3.3'
8493
services:
8594
alist:
86-
restart: always
95+
image: 'xhofe/alist:main'
96+
container_name: alist
8797
volumes:
8898
- '/etc/alist:/opt/alist/data'
8999
ports:
@@ -92,8 +102,7 @@ services:
92102
- PUID=0
93103
- PGID=0
94104
- UMASK=022
95-
container_name: alist
96-
image: 'xhofe/alist:main'
105+
restart: unless-stopped
97106
```
98107
99108
### **Specify version**

docs/zh/guide/install/docker.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,16 @@ docker exec -it alist ./alist admin set NEW_PASSWORD
4343
##### **docker-cli**
4444

4545
```bash
46-
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
46+
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
4747
```
4848

4949
##### **docker-compose**
5050
```yaml
5151
version: '3.3'
5252
services:
5353
alist:
54-
restart: always
54+
image: 'xhofe/alist:latest'
55+
container_name: alist
5556
volumes:
5657
- '/etc/alist:/opt/alist/data'
5758
ports:
@@ -60,8 +61,7 @@ services:
6061
- PUID=0
6162
- PGID=0
6263
- UMASK=022
63-
container_name: alist
64-
image: 'xhofe/alist:latest'
64+
restart: unless-stopped
6565
```
6666
6767
### **使用 aria2 离线下载**
@@ -75,15 +75,30 @@ services:
7575
##### **docker-cli**
7676
7777
```bash
78-
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
78+
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
7979
```
8080

8181
##### **docker-compose**
82+
83+
```bash
84+
#创建一个目录
85+
mkdir /etc/alist
86+
#进入该目录
87+
cd /etc/alist
88+
#下载docker-compose.yml文件
89+
wget https://alist.nn.ci/docker-compose.yml
90+
#运行容器
91+
docker-compose up -d
92+
```
93+
94+
**你也可以自行创建一个包含以下内容的`docker-compose.yml`文件**
95+
8296
```yaml
8397
version: '3.3'
8498
services:
8599
alist:
86-
restart: always
100+
image: 'xhofe/alist:main'
101+
container_name: alist
87102
volumes:
88103
- '/etc/alist:/opt/alist/data'
89104
ports:
@@ -92,8 +107,7 @@ services:
92107
- PUID=0
93108
- PGID=0
94109
- UMASK=022
95-
container_name: alist
96-
image: 'xhofe/alist:main'
110+
restart: unless-stopped
97111
```
98112
99113
### **指定版本**

0 commit comments

Comments
 (0)