diff --git a/docker/Dockerfile b/docker/Dockerfile index 91118109f..4c7da5972 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -24,4 +24,4 @@ RUN pip3 install -r ./wren-sqlglot-server/requirements.txt COPY entrypoint.sh ./ RUN chmod +x ./entrypoint.sh -CMD ./entrypoint.sh ${WREN_JAR} +CMD ./entrypoint.sh ${WREN_JAR} ${MAX_HEAP_SIZE} ${MIN_HEAP_SIZE} diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 2d3550e79..7353f5fc7 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,6 +1,9 @@ +#!/bin/bash +export ENV_MAX_HEAP_SIZE=$2 +export ENV_MIN_HEAP_SIZE=$3 python3 wren-sqlglot-server/main.py & # Required add-opens=java.nio=ALL-UNNAMED for Apache arrow in the Snowflake -java -Dconfig=etc/config.properties \ +java -Xmx${ENV_MAX_HEAP_SIZE:-"512m"} -Xms${ENV_MIN_HEAP_SIZE:-"64m"} -Dconfig=etc/config.properties \ --add-opens=java.base/java.nio=ALL-UNNAMED \ -jar $1