forked from ezsystems/ezplatform-ee-demo
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
153 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM debian:jessie | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
# Use packages from Varnish to get Varnsih 5.1, currently does not work on debian:stretch | ||
RUN apt-get update -q -y && \ | ||
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 && \ | ||
apt-get install -q -y --force-yes --no-install-recommends varnish | ||
|
||
# This will need debian:stretch, just here for referance, had segmentation faults so rather using varnsih 5.1 above | ||
#RUN \ | ||
# apt-get update -q -y && \ | ||
# apt-get install -q -y --force-yes --no-install-recommends ca-certificates varnish-modules varnish | ||
|
||
|
||
EXPOSE 80 6082 | ||
|
||
CMD ["varnishd", "-F", "-a", ":80", "-T", ":6082", "-f", "/etc/varnish/default.vcl", "-s", "malloc,256M"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Custom parameters.vcl for docker use | ||
|
||
backend ezplatform { | ||
.host = "web"; | ||
.port = "80"; | ||
} | ||
|
||
// ACL for invalidators IP | ||
acl invalidators { | ||
"127.0.0.1"; | ||
"172.16.0.0"/20; | ||
"app"; | ||
} | ||
|
||
// ACL for debuggers IP | ||
acl debuggers { | ||
"127.0.0.1"; | ||
"172.16.0.0"/20; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
version: '2.1' | ||
# Simple single server setup for prod | ||
|
||
## WARNING! | ||
# This service is currently work in progress, is not tested by CI, and thus not guaranteed to work. | ||
# You are however more then welcome to try it out and help make it stable. | ||
|
||
services: | ||
app: | ||
environment: | ||
- SYMFONY_HTTP_CACHE=0 | ||
- SYMFONY_TRUSTED_PROXIES=varnish | ||
- HTTPCACHE_PURGE_SERVER=http://varnish | ||
|
||
varnish: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile-varnish | ||
image: my_varnish | ||
mem_limit: 384M | ||
memswap_limit: 512M | ||
ports: | ||
- "8081:80" | ||
depends_on: | ||
- web | ||
volumes: | ||
- ${COMPOSE_DIR}/../varnish/vcl/varnish4.vcl:/etc/varnish/default.vcl:ro | ||
- ${COMPOSE_DIR}/entrypoint/varnish/parameters.vcl:/etc/varnish/parameters.vcl:ro | ||
|
||
|
||
## DEBUG?? | ||
# In need of debugging all request going to Varnish, use varnishlog, example: | ||
# docker-compose exec varnish varnishlog -c -i ReqURL,ReqMethod -I ReqHeader:X-Location-Id | ||
# Or more relevant only BAN's with all info: | ||
# docker-compose exec varnish varnishlog -g request -q "ReqMethod eq 'BAN'" | ||
# | ||
# But before doing that check that http and not local purge client is set: | ||
# docker-compose exec app app/console --env=dev debug:container ezpublish.http_cache.purge_client | ||
# | ||
# And if in prod make sure you have rebuilt app container on code changes ;) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Our Backend - Assuming that web server is listening on port 80 | ||
// Replace the host to fit your setup | ||
// | ||
// For additional example see: doc/docker-compose/entrypoint/varnish/parameters.vcl | ||
|
||
backend ezplatform { | ||
.host = "127.0.0.1"; | ||
.port = "80"; | ||
} | ||
|
||
// ACL for invalidators IP | ||
acl invalidators { | ||
"127.0.0.1"; | ||
"192.168.0.0"/16; | ||
} | ||
|
||
// ACL for debuggers IP | ||
acl debuggers { | ||
"127.0.0.1"; | ||
"192.168.0.0"/16; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters