nicolasff / webdis

A Redis HTTP interface with JSON output
https://webd.is
BSD 2-Clause "Simplified" License
2.82k stars 307 forks source link

docker file to pass in redis host and port as ENV variables instead of setting up in webdis.json #181

Closed zcaudate closed 3 years ago

zcaudate commented 3 years ago

I'd like to be able to spin up a docker instance of webdis and connect it to an already existing redis server.

Currently it's a bit difficult to do that. Being able to pass in ENV variables will make it easier.

nicolasff commented 3 years ago

Hi @zcaudate,

Sorry for the late response. You can create a config file where the redis_host field points to an environment variable; see the documentation for this feature here.

Your webdis.json should look something like this:

{
    "redis_host": "$REDIS_HOST",
    "redis_port": "$REDIS_PORT",
}
zcaudate commented 3 years ago

Ah awesome. That makes a lot of sense. Thanks heaps.