Skip to content

Commit

Permalink
[Docker] Add env variable for malloc size
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Aug 24, 2017
1 parent 20a92e6 commit 17011d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion doc/docker/Dockerfile-varnish
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ RUN apt-get update -q -y && \
COPY doc/varnish/vcl/varnish4.vcl /etc/varnish/default.vcl
COPY doc/docker/entrypoint/varnish/parameters.vcl /etc/varnish/parameters.vcl

ENV VARNISH_MALLOC_SIZE="256M"

EXPOSE 80 6082

CMD ["varnishd", "-F", "-a", ":80", "-T", ":6082", "-f", "/etc/varnish/default.vcl", "-s", "malloc,256M"]
# CMD in shell form to be able to use env variables here
CMD varnishd -F -a :80 -T :6082 -f /etc/varnish/default.vcl -s malloc,${VARNISH_MALLOC_SIZE}
3 changes: 2 additions & 1 deletion doc/docker/varnish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ services:
image: my_varnish
ports:
- "8081:80"
environment:
- VARNISH_MALLOC_SIZE=256m
depends_on:
- web
- app
networks:
- frontend
- backend


## 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
Expand Down

0 comments on commit 17011d1

Please sign in to comment.