EZP-27542: Add support for using Varnish with Docker - #188
Conversation
|
Hello @andrerom, I think this PR should be split into 2, the 3 files for the configuration injection on one side and the docker/automated test complexity on the other. I have a use case in PROD (no docker), on AWS where I would love to just have to:
Even better and more globally it will be great to use that: It would avoid a cache clear. My scenario is, if for any reason I am adding a Varnish, I need to update the config of the web server. Let me know I can PR something especially for that. ++ |
This is for 1.7 (symfony 2.8), implied is that it will need to be adjusted when merged into 2.0 branch where we already use For the rest, I'll see if I can get the container running, if not I'll split up. |
|
Passing 🎉 also fixed platformui profile failures caused by random Stash failures (random bug) by instead using redis for that one for now, adding some coverage for redis while at it. |
Both since it randomly crashes with Stash error when directories are attempted to be deleted between tests, and to get coverage with redis.
|
Ready for review Review notesThe VCL added here is maybe something that could be part of the main one, but the difference is: diff --git a/doc/varnish/vcl/varnish4.vcl b/doc/varnish/vcl/varnish4.vcl
index 8d743b6..7be2e95 100644
--- a/doc/varnish/vcl/varnish4.vcl
+++ b/doc/varnish/vcl/varnish4.vcl
@@ -6,20 +6,21 @@ vcl 4.0;
// Our Backend - Assuming that web server is listening on port 80
// Replace the host to fit your setup
backend ezplatform {
- .host = "127.0.0.1";
+ .host = "web";
.port = "80";
}
// ACL for invalidators IP
acl invalidators {
"127.0.0.1";
- "192.168.0.0"/16;
+ "172.16.0.0"/20;
+ "app";
}
// ACL for debuggers IP
acl debuggers {
"127.0.0.1";
- "192.168.0.0"/16;
+ "172.16.0.0"/20;
}So it's a bit specific. |
| # Use packages from Varnish to get Varnsih 5.1 which is a bit more stable then Varnsih 5.0.0 in stretch | ||
| RUN apt-get install -q -y --force-yes --no-install-recommends ca-certificates curl \ | ||
| curl -s https://packagecloud.io/install/repositories/varnishcache/varnish5/script.deb.sh | bash | ||
| # Use packages from Varnish to get Varnsih 5.1, currently does not work on debian:stretch |
| apt-get install -q -y --force-yes --no-install-recommends varnish | ||
|
|
||
| # If we need varnish modules this is one way, or we need to find a way to install on the package above. | ||
| # This will need debian:stretch, just here for referance, had segmentation faults so rather using varnsih 5.1 above |
|
+1 for the PR About the Varnish config, to avoid 2 files, we could: c) is my preferred way |
|
Thanks for the fixes @glye. @Plopix I'm also fine with c) or b), but b) would bump requirement to 5.x right? @bdunogier what's your take/pref? |
|
@andrerom include works on 4.x ;) |
|
👍 Red code is dead code is good code. |
|
👍 yes that is cool! |
Alternative try to #143.
Adds: