amangs commited on
Commit
4022761
·
1 Parent(s): 02acdde

Fix supergateway resolution and binary execution fallback

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -3
  2. services/15-supergateway.sh +14 -2
Dockerfile CHANGED
@@ -195,9 +195,7 @@ RUN curl -fsSL "https://github.com/oven-sh/bun/releases/latest/download/bun-linu
195
  COPY security/stub-playwright-index.js /tmp/stub-pw.js
196
  COPY security/stub-playwright-index.mjs /tmp/stub-pw.mjs
197
  RUN npm install -g supergateway@latest rea-agents@latest opencode-ai @deepseek-ai/dsh pnpm yarn typescript && \
198
- ln -sf "$(which supergateway || find / -name supergateway 2>/dev/null | head -1)" /usr/local/bin/supergateway && \
199
- ln -sf "$(which rea || find / -name rea 2>/dev/null | head -1)" /usr/local/bin/rea && \
200
- which supergateway rea opencode && \
201
  cp /tmp/stub-pw.js /usr/local/lib/node_modules/rea-agents/node_modules/playwright-core/index.js 2>/dev/null || true && \
202
  cp /tmp/stub-pw.mjs /usr/local/lib/node_modules/rea-agents/node_modules/playwright-core/index.mjs 2>/dev/null || true && \
203
  rm -f /tmp/stub-pw.* && \
 
195
  COPY security/stub-playwright-index.js /tmp/stub-pw.js
196
  COPY security/stub-playwright-index.mjs /tmp/stub-pw.mjs
197
  RUN npm install -g supergateway@latest rea-agents@latest opencode-ai @deepseek-ai/dsh pnpm yarn typescript && \
198
+ chmod 755 /usr/local/bin/* || true && \
 
 
199
  cp /tmp/stub-pw.js /usr/local/lib/node_modules/rea-agents/node_modules/playwright-core/index.js 2>/dev/null || true && \
200
  cp /tmp/stub-pw.mjs /usr/local/lib/node_modules/rea-agents/node_modules/playwright-core/index.mjs 2>/dev/null || true && \
201
  rm -f /tmp/stub-pw.* && \
services/15-supergateway.sh CHANGED
@@ -44,8 +44,20 @@ if [ -z "$API_KEY" ]; then
44
  fi
45
 
46
  cd /data/workspace || exit 1
47
- CMD="$(which supergateway || find /usr -name supergateway 2>/dev/null | head -1 || echo /usr/local/bin/supergateway)"
48
- REA_CMD="$(which rea || find /usr -name rea 2>/dev/null | head -1 || echo /usr/local/bin/rea)"
 
 
 
 
 
 
 
 
 
 
 
 
49
  exec "$CMD" \
50
  --stdio "$REA_CMD mcp" \
51
  --outputTransport streamableHttp \
 
44
  fi
45
 
46
  cd /data/workspace || exit 1
47
+ CMD="/usr/local/bin/supergateway"
48
+ if [ ! -x "$CMD" ]; then
49
+ CMD="$(command -v supergateway || find /usr -name supergateway 2>/dev/null | head -1)"
50
+ fi
51
+ REA_CMD="/usr/local/bin/rea"
52
+ if [ ! -x "$REA_CMD" ]; then
53
+ REA_CMD="$(command -v rea || find /usr -name rea 2>/dev/null | head -1)"
54
+ fi
55
+
56
+ if [ -z "$CMD" ] || [ ! -x "$CMD" ]; then
57
+ echo "ERROR: supergateway binary not found or not executable: $CMD" >> "$LOG"
58
+ exit 1
59
+ fi
60
+
61
  exec "$CMD" \
62
  --stdio "$REA_CMD mcp" \
63
  --outputTransport streamableHttp \