Varnish 6.x, Drupal 8.4+, WSL, Docker Desktop

Varnish + Drupal using Alpine Linux Docker Containers

Time to revisit an old trusty friend

Spoiler Alert: those Docker images ain’t nowhere on Docker Hub !!
Multiple Varnish containers running in my compose stack.

Bibliography

A little dive into Docker Compose architecture

Docker Compose dependencies

# inside example docker-compose.ymlvarnish:
image: alexanderallen/varnish-6:alpine-3.12
depends_on:
- nginx

Coupled Varnish/Nginx instances using decoupled service names

-F -s malloc,32M -a :80 -b nginx:8080
-F -s malloc,32M -a :80 -b 127.0.0.1:8080

Using PHP-FPM and NGINX Container Pairs

Namespacing resources in Docker (such as volumes)

Scaling Containers Using Service Aliases

Like compose services, all Ricks are have the same name. How would you identify them? Credit: Adult Swim.

Giving Docker Compose services a network alias

Using unique service aliases with variables
Sharing external networks between services and applications
Fully updated example of using service aliases
If services where Rick and Morty…
Rick (Varnish) and Morty (Nginx) can finally talk to each other.
Docker Compose applications and w their respective service containers

Smoke Test

Comparing regular NGINX versus Varnish response for Drupal install page.
Retrieving ephemeral container ports
White glove service and luxurious DX: opening browser tabs for you !!

Conclusion: Some deep reflections of today’s cartoon analogy

Organic, fair-sourced DevOps and Full-Stack things. This is a BYOB Establishment — Bring Your Own hipster Beard.

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store