Skip to content

Commit

Permalink
alist fly部署文件
Browse files Browse the repository at this point in the history
  • Loading branch information
lushi78778 committed Dec 25, 2023
0 parents commit e81cdd4
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
15 changes: 15 additions & 0 deletions .github/workflows/fly.yml.temple
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Fly Deploy
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work

# fly.toml
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM xhofe/alist:latest
LABEL MAINTAINER="[email protected]"
VOLUME /opt/alist/data/
WORKDIR /opt/alist/
COPY entrypoint.sh /entrypoint.sh
COPY install.sh /install.sh
RUN chmod +x /entrypoint.sh /install.sh; \
/install.sh
ENV PUID=0 PGID=0 UMASK=022
EXPOSE 5244 6800
ENTRYPOINT [ "/entrypoint.sh" ]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ALIST-FLY

是alist务服的fly.io部署形式

12 changes: 12 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
chown -R ${PUID}:${PGID} /opt/alist/

umask ${UMASK}

exec su-exec ${PUID}:${PGID} nohup aria2c \
--enable-rpc \
--rpc-allow-origin-all \
--conf-path=/root/.aria2/aria2.conf \
>/dev/null 2>&1 &

exec su-exec ${PUID}:${PGID} ./alist server --no-prefix
52 changes: 52 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# fly.toml app configuration file generated for lushi-alist-v2 on 2023-12-19T01:07:17+08:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "lushi-alist-v2"
primary_region = "hkg"
kill_signal = "SIGINT"
kill_timeout = "5s"

[experimental]
auto_rollback = true

[build]

[[mounts]]
source = "data"
destination = "/opt/alist/data"
auto_extend_size_threshold = 0

[http_service]
internal_port = 5244
force_https = true
auto_stop_machines = false
auto_start_machines = true
min_machines_running = 0
processes = ["app"]

[[services]]
protocol = "tcp"
internal_port = 5244
min_machines_running = 0
processes = ["app"]

[[services.ports]]
port = 80
handlers = ["http"]
force_https = true

[[services.ports]]
port = 443
handlers = ["tls", "http"]

[[services.tcp_checks]]
interval = "15s"
timeout = "2s"
grace_period = "1s"

[[vm]]
cpu_kind = "shared"
cpus = 1
memory_mb = 256
10 changes: 10 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apk add --no-cache aria2 curl

mkdir -p /root/.aria2
cd /root/.aria2
wget https://github.com/P3TERX/aria2.conf/archive/refs/heads/master.tar.gz
tar -zxvf master.tar.gz --strip-components=1
rm -rf master.tar.gz
sed -i 's|rpc-secret|#rpc-secret|g' ./aria2.conf
touch /root/.aria2/aria2.session
./tracker.sh

0 comments on commit e81cdd4

Please sign in to comment.