Skip to content

Commit

Permalink
feat(docker): allow overriding config file for docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
aesedepece committed Nov 11, 2024
1 parent b97a9aa commit 792cd39
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docker/witnet-rust/runner.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

WITNET_FOLDER="/.witnet"
CONFIG_FILE_FROM_CMD=$(echo "$@" | sed -E 's/(.*-c\s*)?(.*\.toml)?.*/\2/')
CONFIG_FILE=${CONFIG_FILE_FROM_CMD:-$WITNET_FOLDER/config/witnet.toml}
COMMAND=$(echo "$@" | sed -E 's/(.*-c\s*)?(.*\.toml)?//')

ERROR_BANNER="
██████╗██████╗ █████╗ ███████╗██╗ ██╗██╗
Expand Down Expand Up @@ -52,6 +57,6 @@ while true; do

# Run the node itself, using configuration from the default directory and passing down any arguments that may be
# appended when running "docker run"
RUST_LOG=witnet=$LOG_LEVEL /tmp/witnet-raw -c /.witnet/config/witnet.toml "$@" || echo "$ERROR_BANNER"
RUST_LOG=witnet=$LOG_LEVEL /tmp/witnet-raw -c "$CONFIG_FILE" "$COMMAND" || echo "$ERROR_BANNER"
sleep 30
done

0 comments on commit 792cd39

Please sign in to comment.