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

# Set default varnish memory cache size if not specified
if [ -z "$MEMSIZE" ]; then
export MEMSIZE=64M
# Set varnish secret if not specified
if [ ! -f /etc/varnish/secret ]; then
if [ -z "$SECRET" ]; then
SECRET=`cat /proc/sys/kernel/random/uuid`
echo $SECRET > /etc/varnish/secret
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 -T -S /etc/varnish/secret -F -s malloc,${MEMSIZE} $@