Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add varnish container with configurations #441

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

epolish
Copy link

@epolish epolish commented Apr 1, 2021

No description provided.

Copy link

@st3phani st3phani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good

@markshust
Copy link
Owner

Is there a non-invasive way this can be implemented? Meaning, 95% of devs will not need this, but I'd like to provide Varnish as a capability, so long as the 95% can keep this disabled. It'd be nice to have an option to toggle Varnish on/off.

@epolish
Copy link
Author

epolish commented Oct 14, 2021

There is a problem with ssl termination...
Varnish can't handle ssl traffic itself... so we need something like nginx to proxy the traffic.
But I'll research some options with varnish official ssl offloader - hitch

@epolish
Copy link
Author

epolish commented Oct 14, 2021

And I can say that varnish is must have for developing in scope of magento cloud projects.
Because we cannot much configure on nginx m2 cloud because we only have an access to fastly which is varnish...

@epolish
Copy link
Author

epolish commented Oct 14, 2021

I'll do some research with it anyway

@markshust
Copy link
Owner

Ok cool. This ticket may be related #243. Ideally, Nginx should sort of be executed outside of the scope of this project even, so this can provide the ability to run many Magento instances at once. This is probably part of a larger future update, but it's something I've been thinking about a lot.

@AlphaTeknovaAdmin
Copy link

For multiple local instances like valet?

@chrom
Copy link

chrom commented Dec 23, 2021

add varnish container - good Idia!
ability to run many Magento instances at once - it already looks like kubernetes is suitable here

@markshust markshust added the WTD label Dec 4, 2022
@what-the-diff
Copy link

what-the-diff bot commented Dec 4, 2022

  • Added varnish to docker-compose.dev.yml and docker-compose.yml
  • Changed port from 80:8000 to 8080:8000 in nginx service of both files
  • Created new file images/varnish/4,0/Dockerfile with content FROM eeacms/varnish COPY varnish,vcl /etc/varinshconfd/. This is the Docker image for Varnisg 4 which will be used by Magento 2 (Varnsih 6 does not work)
    4..Created a default config file for Varnsh at images\vanish\40\default,vc1 based on https://githubemagagioeea_dockerfilesblobmastermagentovarinshdefauitvc1 but modified it so that it works with our setup - see comments in this vc1 file above
  • Added a new backend default
  • Set the first_byte_timeout to 600s
  • Created an ACL for purge requests and added IP addresses of app, varnish, phpfpm and host docker gateway
  • In vcl_recv: If request method is PURGE then check if client ip matches with any one in the ACL created above else return 405 error code (Method not allowed) or 400 error code (X-Magento-Tags-Pattern or X-Pool header required). Also ban objects based on headers received from proxy server/load balancer i.e., X-Magento Tags Pattern & Pool respectively

@mucan54
Copy link
Contributor

mucan54 commented May 21, 2023

Anyone needs varnish can use this command for online setup:

curl -s https://raw.githubusercontent.com/mucan54/docker-magento-varnish/main/lib/onelinesetup | bash -s -- magento.test 2.4.6 community

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants