File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ RUN printf '%s\n' '#!/usr/bin/env bash' 'exec node /clawdbot/dist/entry.js "$@"'
6262
6363COPY src ./src
6464
65+ # The wrapper listens on this port.
66+ ENV CLAWDBOT_PUBLIC_PORT=8080
6567ENV PORT=8080
6668EXPOSE 8080
6769CMD ["node" , "src/server.js" ]
Original file line number Diff line number Diff line change @@ -8,8 +8,11 @@ import express from "express";
88import httpProxy from "http-proxy" ;
99import * as tar from "tar" ;
1010
11- // Railway commonly sets PORT=8080 for HTTP services.
12- const PORT = Number . parseInt ( process . env . PORT ?? "8080" , 10 ) ;
11+ // Railway deployments sometimes inject PORT=3000 by default. We want the wrapper to
12+ // reliably listen on 8080 unless explicitly overridden.
13+ //
14+ // Prefer CLAWDBOT_PUBLIC_PORT (set in the Dockerfile / template) over PORT.
15+ const PORT = Number . parseInt ( process . env . CLAWDBOT_PUBLIC_PORT ?? process . env . PORT ?? "8080" , 10 ) ;
1316const STATE_DIR = process . env . CLAWDBOT_STATE_DIR ?. trim ( ) || path . join ( os . homedir ( ) , ".clawdbot" ) ;
1417const WORKSPACE_DIR = process . env . CLAWDBOT_WORKSPACE_DIR ?. trim ( ) || path . join ( STATE_DIR , "workspace" ) ;
1518
You can’t perform that action at this time.
0 commit comments