2024-07-23 20:50:16 +08:00
|
|
|
|
#!/bin/bash
|
2024-11-19 00:00:28 +08:00
|
|
|
|
declare install_path=$1
|
|
|
|
|
declare service_port=$2
|
|
|
|
|
cd $install_path
|
2024-07-24 12:50:44 +08:00
|
|
|
|
cat > "docker-compose.yml" << EOF
|
|
|
|
|
version: '3.8'
|
|
|
|
|
services:
|
|
|
|
|
alist:
|
|
|
|
|
image: xhofe/alist:latest
|
|
|
|
|
container_name: alist
|
|
|
|
|
restart: always
|
|
|
|
|
volumes:
|
|
|
|
|
- ./:/opt/alist/data
|
|
|
|
|
ports:
|
2024-11-19 00:00:28 +08:00
|
|
|
|
- "${service_port}:5244"
|
2024-07-24 12:50:44 +08:00
|
|
|
|
EOF
|
2024-11-18 23:12:52 +08:00
|
|
|
|
docker compose up -d || echo "安装失败" && exit
|
|
|
|
|
declare admin_password=$( docker exec -it alist ./alist admin random | grep password | awk '{print $4}')
|
2024-07-24 12:50:44 +08:00
|
|
|
|
echo "账号:admin"
|
2024-11-18 23:12:52 +08:00
|
|
|
|
echo "密码:${admin_password}"
|