Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改docker重启策略为unless-stopped #295

Merged
merged 11 commits into from
Jan 6, 2024
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