fix(setup): 预创建 /srv/taiko-web/public/songs 并在 systemd 注入 TAIKO_WEB_SONGS_DIR 环境变量
This commit is contained in:
4
setup.sh
4
setup.sh
@@ -59,6 +59,9 @@ mkdir -p /srv/taiko-web
|
||||
SRC_DIR=$(cd "$(dirname "$0")" && pwd)
|
||||
rsync -a --delete --exclude '.git' --exclude '.venv' "$SRC_DIR/" /srv/taiko-web/
|
||||
|
||||
echo "预创建歌曲存储目录..."
|
||||
mkdir -p /srv/taiko-web/public/songs
|
||||
|
||||
echo "创建并安装 Python 虚拟环境..."
|
||||
python3 -m venv /srv/taiko-web/.venv
|
||||
/srv/taiko-web/.venv/bin/pip install -U pip
|
||||
@@ -80,6 +83,7 @@ After=network.target mongod.service redis-server.service
|
||||
Type=simple
|
||||
WorkingDirectory=/srv/taiko-web
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
Environment=TAIKO_WEB_SONGS_DIR=/srv/taiko-web/public/songs
|
||||
ExecStart=/srv/taiko-web/.venv/bin/gunicorn -b 0.0.0.0:80 app:app
|
||||
Restart=always
|
||||
User=www-data
|
||||
|
||||
Reference in New Issue
Block a user