Skip to content
Snippets Groups Projects
Commit ae5f0a96 authored by Gilles Filippini's avatar Gilles Filippini
Browse files

build (docker): env var for dev mode and prometheus

parent 8527dc7e
No related branches found
No related tags found
1 merge request!7build: docker image and compose file
This commit is part of merge request !7. Comments created here will be created in the context of that merge request.
...@@ -15,6 +15,8 @@ services: ...@@ -15,6 +15,8 @@ services:
- "30333:30333" - "30333:30333"
environment: environment:
DUNITER_INSTANCE_NAME: "my_instance" DUNITER_INSTANCE_NAME: "my_instance"
DUNITER_DEVELOPMENT_MODE: "true"
#DUNITER_DISABLE_PROMETHEUS: "false"
volumes: volumes:
- data:/var/lib/lc-core - data:/var/lib/lc-core
......
#!/bin/sh #!/bin/sh
function boolean () {
echo "$1" | sed -E 's/^(true|yes|1)$/true/i'
}
function ternary () {
if [ $(boolean "$1") = true ]; then
echo "$2"
else
echo "$3"
fi
}
if [ -n "$DUNITER_INSTANCE_NAME" ]; then if [ -n "$DUNITER_INSTANCE_NAME" ]; then
set -- "$@" --name "$DUNITER_INSTANCE_NAME" set -- "$@" --name "$DUNITER_INSTANCE_NAME"
fi fi
exec lc-core --dev --no-prometheus --ws-external -d /var/lib/lc-core "$@" DUNITER_DISABLE_PROMETHEUS=$(boolean "${DUNITER_DISABLE_PROMETHEUS:-false}")
DUNITER_DEVELOPMENT_MODE=$(boolean "${DUNITER_DEVELOPMENT_MODE:-false}")
set -- "$@" \
$(ternary "${DUNITER_DEVELOPMENT_MODE:-false}" --dev) \
$(ternary "${DUNITER_DISABLE_PROMETHEUS:-false}" --no-prometheus) \
--ws-external -d /var/lib/lc-core
echo "Starting duniter with parameters: $@"
exec lc-core "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment