build(docker): add core application image
This commit is contained in:
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
test "$(id -u)" != "0"
|
||||
|
||||
node_version="$(node --version)"
|
||||
python_version="$(python --version 2>&1)"
|
||||
case "$node_version" in
|
||||
v22.19.*|v22.2[0-9].*|v2[3-9].*|v[3-9][0-9].*) ;;
|
||||
*) echo "Node 22.19+ required, found $node_version" >&2; exit 1 ;;
|
||||
esac
|
||||
case "$python_version" in
|
||||
"Python 3.1"[1-9].*|"Python 3."[2-9][0-9].*) ;;
|
||||
*) echo "Python 3.11+ required, found $python_version" >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
tht --help >/dev/null
|
||||
pi --version >/dev/null
|
||||
|
||||
/app/docker/core-entrypoint.sh server &
|
||||
server_pid=$!
|
||||
trap 'kill "$server_pid" 2>/dev/null || true; wait "$server_pid" 2>/dev/null || true' EXIT INT TERM
|
||||
|
||||
attempt=0
|
||||
until curl --fail --silent --show-error http://127.0.0.1:8787/health >/dev/null; do
|
||||
attempt=$((attempt + 1))
|
||||
if [ "$attempt" -ge 30 ]; then
|
||||
echo "backend health check did not become ready" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "$node_version"
|
||||
echo "$python_version"
|
||||
echo "core smoke: ok"
|
||||
Reference in New Issue
Block a user