mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-11 18:56:21 +00:00
added redis startup and db folder
This commit is contained in:
@@ -47,4 +47,5 @@ services:
|
||||
- 8080:80
|
||||
volumes:
|
||||
- ./data:/app/public/data
|
||||
- ./logs:/app/public/logs
|
||||
- ./logs:/app/public/logs
|
||||
- ./redis:/var/lib/redis # can be commeted out if REDIS_CACHING is set to false
|
||||
@@ -65,7 +65,16 @@ _buildConfig() {
|
||||
|
||||
# starting redis
|
||||
if [[ ${REDIS_CACHING:=true} == true ]]; then
|
||||
echo "[i] Starting Redis"
|
||||
echo "[i] Redis steps"
|
||||
# tell redis how often to save
|
||||
## save <seconds> <changes>
|
||||
echo " [+] Configuring Redis save intervals"
|
||||
echo "save 60 100" >> /etc/redis.conf # every minute if at least 100 keys changed
|
||||
echo "save 300 10" >> /etc/redis.conf # every 5 minutes if at least 10 keys changed
|
||||
echo "save 600 1" >> /etc/redis.conf # every 10 minutes if at least 1 key changed
|
||||
|
||||
# Trap SIGTERM and SIGINT signals to save Redis data before shutdown
|
||||
trap "echo 'Stopping Redis'; redis-cli save; redis-cli shutdown; exit" TERM INT
|
||||
redis-server /etc/redis.conf --daemonize yes
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user