-
Notifications
You must be signed in to change notification settings - Fork 539
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add entrypoint, if MCROUTER_CONFIG_PATH undefined then use the defaul…
…t one written to /etc/mcrouter/mcrouter.json simplify entrypoint. bundle the default mcrouter.json with the Docker image, and now allow to point at an alternative location for the mcrouter json config file
- Loading branch information
Showing
3 changed files
with
37 additions
and
5 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
10 changes: 10 additions & 0 deletions
10
mcrouter/scripts/docker/container/ubuntu-packaged/mcrouter.json
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,10 @@ | ||
{ | ||
"pools": { | ||
"A": { | ||
"servers": [ | ||
"127.0.0.1:5001" | ||
] | ||
} | ||
}, | ||
"route": "PoolRoute|A" | ||
} |
18 changes: 18 additions & 0 deletions
18
mcrouter/scripts/docker/container/ubuntu-packaged/usr/local/bin/entrypoint.sh
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,18 @@ | ||
#!/usr/bin/env bash | ||
set -o errexit | ||
|
||
|
||
function run_mcrouter() { | ||
local CONFIG_PATH=$1 | ||
mcrouter \ | ||
--config file:${CONFIG_PATH} \ | ||
-p "${MCROUTER_LISTEN_PORT:-5000}" | ||
} | ||
|
||
|
||
if [ -z "${MCROUTER_CONFIG_PATH}" ]; then | ||
echo "MCROUTER_CONFIG_PATH undefined! Using bundled default ..." | ||
export MCROUTER_CONFIG_PATH=/etc/mcrouter/mcrouter.json | ||
fi | ||
|
||
run_mcrouter "${MCROUTER_CONFIG_PATH}" "$@" |