Varnish in a docker container
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

20 lines
585 B

#!/bin/sh
# Set default varnish memory cache size if not specified
if [ -z "$MEMSIZE" ]; then
export MEMSIZE=64M
fi
# Set varnish secret if not specified
if [ ! -f /etc/varnish/secret ]; then
if [ -z "$SECRET" ]; then
SECRET=`cat /proc/sys/kernel/random/uuid`
fi
echo $SECRET > /etc/varnish/secret
fi
echo "Secret is `cat /etc/varnish/secret`"
# Check vcl syntax
varnishd -C -f /etc/varnish/default.vcl > /dev/null || exit 1
exec /usr/sbin/varnishd -f /etc/varnish/default.vcl -a 0.0.0.0:80 -T 0.0.0.0:6082 -S /etc/varnish/secret -F -s malloc,${MEMSIZE} $@