From b67c4d33dbae669b631e4b5f0ee6e064758525fc Mon Sep 17 00:00:00 2001 From: Artyom Sayadyan Date: Mon, 30 Jan 2023 14:33:30 +0300 Subject: [PATCH] NODE-2532 Dockerfile improvements (#3805) --- docker/Dockerfile | 4 +++- docker/README.md | 5 +++++ docker/entrypoint.sh | 9 ++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index da852bd3248..644b6f5f5de 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM openjdk:11-jre-slim +FROM eclipse-temurin:11-jre ENV WAVES_LOG_LEVEL=INFO ENV WAVES_HEAP_SIZE=2g @@ -47,5 +47,7 @@ VOLUME $WVLOG VOLUME $WAVES_INSTALL_PATH/lib/plugins WORKDIR $WVDATA +HEALTHCHECK CMD curl -f http://localhost:6869/node/status || exit 1 + STOPSIGNAL SIGINT ENTRYPOINT ["/usr/share/waves/bin/entrypoint.sh"] diff --git a/docker/README.md b/docker/README.md index faef5236d3c..c616c8ddb92 100644 --- a/docker/README.md +++ b/docker/README.md @@ -40,6 +40,11 @@ docker run -v /docker/waves/waves-data:/var/lib/waves -v /docker/waves/waves-con 3. By default, `/etc/waves/waves.conf` config includes `/etc/waves/local.conf`. Custom `/etc/waves/local.conf` can be used to override default config entries. Custom `/etc/waves/waves.conf` can be used to override or the whole configuration. For additional information about Docker volumes mapping please refer to `Managing data` item. +4. You can override the default executable by using the following syntax: +``` +docker run -it wavesplatform/wavesnode [command] [args] +``` + ### Environment variables **You can run container with predefined environment variables:** diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 39f42c2d8aa..91ba7a8114b 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -19,4 +19,11 @@ JAVA_OPTS="-Dlogback.stdout.level=${WAVES_LOG_LEVEL} -Dconfig.override_with_env_vars=true ${JAVA_OPTS}" -java $JAVA_OPTS -cp "${WAVES_INSTALL_PATH}/lib/plugins/*:$WAVES_INSTALL_PATH/lib/*" com.wavesplatform.Application "$WAVES_CONFIG" +if [ $# -eq 0 ] + then + ARGS="$WAVES_CONFIG" + else + ARGS=$@ +fi + +java $JAVA_OPTS -cp "${WAVES_INSTALL_PATH}/lib/plugins/*:$WAVES_INSTALL_PATH/lib/*" com.wavesplatform.Application $ARGS