hopsoft / docker-graphite-statsd

Docker image for Graphite & Statsd
MIT License
867 stars 308 forks source link

Add environment vars to configure Memcached on Graphite #81

Closed lucasdaddiego closed 7 years ago

lucasdaddiego commented 7 years ago

This allows to configure the Memcached options to Graphite, using environment variables, that can be easily added to the container with the -e "ENVVAR=VALUE" option to the docker run command like this:

docker run -d\
--name graphite\
--restart=always\
-p 80:80\
-p 2003-2004:2003-2004\
-p 2023-2024:2023-2024\
-p 8125:8125/udp\
-p 8126:8126\
-e "MEMCACHE_HOST=127.0.0.1:11211"\  # Memcached host. Separate by comma more than one servers.
-e "CACHE_DURATION=60"\              # in seconds
hopsoft/graphite-statsd

Note that this only allows the config to be used by Graphite, this NOT installs a Memcached server in the container.

Also, you can specify more than one memcached server, using commas: -e "MEMCACHE_HOST=127.0.0.1:11211,10.0.0.1:11211"

hopsoft commented 7 years ago

This looks great. Will you add a small section to the README that describes the usage? I'll get this merged once the README is ready. Thanks.

lucasdaddiego commented 7 years ago

Done! Hope you like it.