diff --git a/.gitignore b/.gitignore index 37325190..68f9b56b 100644 --- a/.gitignore +++ b/.gitignore @@ -98,6 +98,11 @@ /cfg/php-startup-7.4/*.sh /cfg/php-startup-8.0/*.sh +# Ignorecustom Varnish configs +/cfg/varnish-4/*.vcl +/cfg/varnish-5/*.vcl +/cfg/varnish-6/*.vcl + # Ignore custom PHP-FPM modules /mod/php-fpm-5.2/*.so /mod/php-fpm-5.3/*.so diff --git a/cfg/varnish-4/README.md b/cfg/varnish-4/README.md new file mode 100644 index 00000000..8cf2ae20 --- /dev/null +++ b/cfg/varnish-4/README.md @@ -0,0 +1,8 @@ +# Custom Varnish configuration + +Place your `*.vcl` files here to customize Varnish. + +* This directory will be mounted into `/etc/varnish.d/` into the Varnish container. +* Ensure to point your `VARNISH_CONFIG` variable to `/etc/varnish.d/.vcl` when you want to use it +* Ensure to set your Backend server to `httpd` in your custom varnish config +* Ensure to set your Backend port to `80` in your custom varnish config diff --git a/cfg/varnish-5/README.md b/cfg/varnish-5/README.md new file mode 100644 index 00000000..8cf2ae20 --- /dev/null +++ b/cfg/varnish-5/README.md @@ -0,0 +1,8 @@ +# Custom Varnish configuration + +Place your `*.vcl` files here to customize Varnish. + +* This directory will be mounted into `/etc/varnish.d/` into the Varnish container. +* Ensure to point your `VARNISH_CONFIG` variable to `/etc/varnish.d/.vcl` when you want to use it +* Ensure to set your Backend server to `httpd` in your custom varnish config +* Ensure to set your Backend port to `80` in your custom varnish config diff --git a/cfg/varnish-6/README.md b/cfg/varnish-6/README.md new file mode 100644 index 00000000..8cf2ae20 --- /dev/null +++ b/cfg/varnish-6/README.md @@ -0,0 +1,8 @@ +# Custom Varnish configuration + +Place your `*.vcl` files here to customize Varnish. + +* This directory will be mounted into `/etc/varnish.d/` into the Varnish container. +* Ensure to point your `VARNISH_CONFIG` variable to `/etc/varnish.d/.vcl` when you want to use it +* Ensure to set your Backend server to `httpd` in your custom varnish config +* Ensure to set your Backend port to `80` in your custom varnish config diff --git a/compose/docker-compose.override.yml-all b/compose/docker-compose.override.yml-all index e0a7fdad..62cb27d3 100644 --- a/compose/docker-compose.override.yml-all +++ b/compose/docker-compose.override.yml-all @@ -84,6 +84,8 @@ services: - VARNISHD_PARAMS=${VARNISH_PARAMS:--p default_ttl=3600 -p default_grace=3600} - BACKEND_HOST=httpd - BACKEND_PORT=80 + volumes: + - ${DEVILBOX_PATH}/cfg/varnish-${VARNISH_SERVER:-6}:/etc/varnish.d depends_on: - bind - php diff --git a/compose/docker-compose.override.yml-varnish b/compose/docker-compose.override.yml-varnish index b60570b8..164a520a 100644 --- a/compose/docker-compose.override.yml-varnish +++ b/compose/docker-compose.override.yml-varnish @@ -15,6 +15,8 @@ services: - VARNISHD_PARAMS=${VARNISH_PARAMS:--p default_ttl=3600 -p default_grace=3600} - BACKEND_HOST=httpd - BACKEND_PORT=80 + volumes: + - ${DEVILBOX_PATH}/cfg/varnish-${VARNISH_SERVER:-6}:/etc/varnish.d depends_on: - bind - php