Merge pull request #191 from tpill90/MinFreeSpace

Add support for `min_free` parameter
This commit is contained in:
James Kinsman 2024-07-08 12:30:04 +01:00 committed by GitHub
commit cefa01356b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View file

@ -11,6 +11,7 @@ ENV GENERICCACHE_VERSION=2 \
WEBUSER=www-data \ WEBUSER=www-data \
CACHE_INDEX_SIZE=500m \ CACHE_INDEX_SIZE=500m \
CACHE_DISK_SIZE=1000g \ CACHE_DISK_SIZE=1000g \
MIN_FREE_DISK=10g \
CACHE_MAX_AGE=3560d \ CACHE_MAX_AGE=3560d \
CACHE_SLICE_SIZE=1m \ CACHE_SLICE_SIZE=1m \
UPSTREAM_DNS="8.8.8.8 8.8.4.4" \ UPSTREAM_DNS="8.8.8.8 8.8.4.4" \
@ -27,7 +28,7 @@ RUN rm /etc/nginx/sites-enabled/* /etc/nginx/stream-enabled/* ;\
rm /etc/nginx/conf.d/gzip.conf ;\ rm /etc/nginx/conf.d/gzip.conf ;\
chmod 754 /var/log/tallylog ; \ chmod 754 /var/log/tallylog ; \
id -u ${WEBUSER} &> /dev/null || adduser --system --home /var/www/ --no-create-home --shell /bin/false --group --disabled-login ${WEBUSER} ;\ id -u ${WEBUSER} &> /dev/null || adduser --system --home /var/www/ --no-create-home --shell /bin/false --group --disabled-login ${WEBUSER} ;\
chmod 755 /scripts/* ;\ chmod 755 /scripts/* ;\
mkdir -m 755 -p /data/cache ;\ mkdir -m 755 -p /data/cache ;\
mkdir -m 755 -p /data/info ;\ mkdir -m 755 -p /data/info ;\
mkdir -m 755 -p /data/logs ;\ mkdir -m 755 -p /data/logs ;\

View file

@ -1 +1 @@
proxy_cache_path /data/cache/cache levels=2:2 keys_zone=generic:CACHE_INDEX_SIZE inactive=CACHE_MAX_AGE max_size=CACHE_DISK_SIZE loader_files=1000 loader_sleep=50ms loader_threshold=300ms use_temp_path=off; proxy_cache_path /data/cache/cache levels=2:2 keys_zone=generic:CACHE_INDEX_SIZE inactive=CACHE_MAX_AGE max_size=CACHE_DISK_SIZE min_free=MIN_FREE_DISK loader_files=1000 loader_sleep=50ms loader_threshold=300ms use_temp_path=off;

View file

@ -13,6 +13,7 @@ echo "worker_processes ${NGINX_WORKER_PROCESSES};" > /etc/nginx/workers.conf
sed -i "s/^user .*/user ${WEBUSER};/" /etc/nginx/nginx.conf sed -i "s/^user .*/user ${WEBUSER};/" /etc/nginx/nginx.conf
sed -i "s/CACHE_INDEX_SIZE/${CACHE_INDEX_SIZE}/" /etc/nginx/conf.d/20_proxy_cache_path.conf sed -i "s/CACHE_INDEX_SIZE/${CACHE_INDEX_SIZE}/" /etc/nginx/conf.d/20_proxy_cache_path.conf
sed -i "s/CACHE_DISK_SIZE/${CACHE_DISK_SIZE}/" /etc/nginx/conf.d/20_proxy_cache_path.conf sed -i "s/CACHE_DISK_SIZE/${CACHE_DISK_SIZE}/" /etc/nginx/conf.d/20_proxy_cache_path.conf
sed -i "s/MIN_FREE_DISK/${MIN_FREE_DISK}/" /etc/nginx/conf.d/20_proxy_cache_path.conf
sed -i "s/CACHE_MAX_AGE/${CACHE_MAX_AGE}/" /etc/nginx/conf.d/20_proxy_cache_path.conf sed -i "s/CACHE_MAX_AGE/${CACHE_MAX_AGE}/" /etc/nginx/conf.d/20_proxy_cache_path.conf
sed -i "s/CACHE_MAX_AGE/${CACHE_MAX_AGE}/" /etc/nginx/sites-available/cache.conf.d/root/20_cache.conf sed -i "s/CACHE_MAX_AGE/${CACHE_MAX_AGE}/" /etc/nginx/sites-available/cache.conf.d/root/20_cache.conf
sed -i "s/slice 1m;/slice ${CACHE_SLICE_SIZE};/" /etc/nginx/sites-available/cache.conf.d/root/20_cache.conf sed -i "s/slice 1m;/slice ${CACHE_SLICE_SIZE};/" /etc/nginx/sites-available/cache.conf.d/root/20_cache.conf