baxin commited on
Commit
21eafbb
·
verified ·
1 Parent(s): fb2899e

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +2 -12
entrypoint.sh CHANGED
@@ -1,14 +1,12 @@
1
  #!/usr/bin/env bash
2
  set -euo pipefail
3
 
4
- # venv activate (あなたの app 用)
5
  if [ -f "/home/user/app/.venv/bin/activate" ]; then
6
  source /home/user/app/.venv/bin/activate
7
  fi
8
 
9
  export PORT="${PORT:-7860}"
10
- export ROBOT_IP="${ROBOT_IP:-127.0.0.1}"
11
- export ROBOT_PORT="${ROBOT_PORT:-31950}"
12
 
13
  echo "[entrypoint] starting robot-server..."
14
  (cd /root/opentrons && make -C robot-server dev) > /tmp/robot-server.log 2>&1 &
@@ -21,21 +19,13 @@ for i in {1..60}; do
21
  echo "[entrypoint] robot-server is up"
22
  break
23
  fi
24
-
25
  if ! kill -0 "${ROBOT_SERVER_PID}" >/dev/null 2>&1; then
26
  echo "[entrypoint] robot-server exited early. Last logs:"
27
  tail -n 200 /tmp/robot-server.log || true
28
  exit 1
29
  fi
30
-
31
  sleep 1
32
  done
33
 
34
- if ! (echo > /dev/tcp/127.0.0.1/31950) >/dev/null 2>&1; then
35
- echo "[entrypoint] robot-server did not start in time. Last logs:"
36
- tail -n 200 /tmp/robot-server.log || true
37
- exit 1
38
- fi
39
-
40
  echo "[entrypoint] starting FastAPI on 0.0.0.0:${PORT} ..."
41
- exec uvicorn api:app --host 0.0.0.0 --port "${PORT}"
 
1
  #!/usr/bin/env bash
2
  set -euo pipefail
3
 
4
+ # venv activate
5
  if [ -f "/home/user/app/.venv/bin/activate" ]; then
6
  source /home/user/app/.venv/bin/activate
7
  fi
8
 
9
  export PORT="${PORT:-7860}"
 
 
10
 
11
  echo "[entrypoint] starting robot-server..."
12
  (cd /root/opentrons && make -C robot-server dev) > /tmp/robot-server.log 2>&1 &
 
19
  echo "[entrypoint] robot-server is up"
20
  break
21
  fi
 
22
  if ! kill -0 "${ROBOT_SERVER_PID}" >/dev/null 2>&1; then
23
  echo "[entrypoint] robot-server exited early. Last logs:"
24
  tail -n 200 /tmp/robot-server.log || true
25
  exit 1
26
  fi
 
27
  sleep 1
28
  done
29
 
 
 
 
 
 
 
30
  echo "[entrypoint] starting FastAPI on 0.0.0.0:${PORT} ..."
31
+ exec uvicorn api:app --app-dir /home/user/app --host 0.0.0.0 --port "${PORT}"