👷 Docker redis supports data permanence, fix #74 (#75)

👷 Docker redis 支持数据永久化, fix #74 (#75)
This commit is contained in:
nevinen 2021-05-08 21:52:36 +08:00 committed by GitHub
parent 60765e1697
commit a7fa55e01b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 11 deletions

View File

@ -2,10 +2,7 @@
cd /pagermaid/workdir
git remote set-url origin https://github.com/Xtao-Labs/PagerMaid-Modify.git
requir_old=$(cat requirements.txt)
git pull
[[ $requir_old != $(cat requirements.txt) ]] && {
pip install -r requirements.txt
exit 0
}

View File

@ -1,7 +1,9 @@
#!/usr/bin/with-contenv bash
if [[ $RUN_AS_ROOT != true ]]; then
exec s6-setuidgid pagermaid redis-server --daemonize yes
else
redis-server --daemonize yes
fi
perl -i -pe "{
s|^dir /var/lib/redis|dir /pagermaid/workdir|;
s|^save \d+ 1|save 60 1|;
}" /etc/redis/redis.conf
cd /pagermaid/workdir
redis-server /etc/redis/redis.conf

View File

@ -4,6 +4,6 @@ cd /pagermaid/workdir
if [[ $RUN_AS_ROOT != true ]]; then
exec s6-setuidgid pagermaid python -m pagermaid
else
python -m pagermaid
exec s6-setuidgid root python -m pagermaid
fi