Skip to content

Commit 2062a20

Browse files
committed
Bind uvicorn to 0.0.0.0 to allow containerized dev server use
1 parent a82708f commit 2062a20

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

run.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/bin/bash
22

3+
THIS_FILE=`basename "$0"`
4+
35
if [ -z "$OPTIMADE_CONFIG_FILE" ]; then
46
export OPTIMADE_CONFIG_FILE="./optimade_config.json"
5-
echo "Using the demo config file at ${OPTIMADE_CONFIG_FILE}."
6-
echo "Set the environment variable OPTIMADE_CONFIG_FILE to override this behaviour."
7-
echo "For more configuration options, please see https://www.optimade.org/optimade-python-tools/configuration/."
7+
echo -e "INFO:\t[${THIS_FILE}] Using the demo config file at ${OPTIMADE_CONFIG_FILE}."
8+
echo -e "INFO:\t[${THIS_FILE}] Set the environment variable OPTIMADE_CONFIG_FILE to override this behaviour."
9+
echo -e "INFO:\t[${THIS_FILE}] For more configuration options, please see https://www.optimade.org/optimade-python-tools/configuration/."
810
fi
911

1012
export OPTIMADE_LOG_LEVEL=info
@@ -29,4 +31,6 @@ else
2931
fi
3032
fi
3133

32-
uvicorn optimade.server.$MAIN:app --reload --port $PORT --log-level $OPTIMADE_LOG_LEVEL
34+
echo -e "INFO:\t[${THIS_FILE}] Launching the development server with uvicorn for the ${MAIN} app on port ${PORT} with log level ${OPTIMADE_LOG_LEVEL}."
35+
36+
uvicorn optimade.server.$MAIN:app --reload --port $PORT --log-level $OPTIMADE_LOG_LEVEL --host 0.0.0.0

0 commit comments

Comments
 (0)