fix: Use Node.js serve for robust port binding on Railway

This commit is contained in:
OpenClaw Agent 2026-02-02 12:00:25 +00:00
parent 7116eb3466
commit 241a9d0dd7

View file

@ -1,10 +1,14 @@
FROM nginx:alpine FROM node:20-alpine
# Copy static assets to Nginx html folder # Install simple static file server
COPY . /usr/share/nginx/html RUN npm install -g serve
# Expose port 80 # Create app directory
EXPOSE 80 WORKDIR /app
# Start Nginx # Copy all files
CMD ["nginx", "-g", "daemon off;"] COPY . .
# Start server on the port defined by Railway ($PORT)
# If $PORT is not set, default to 3000
CMD serve -s . -l tcp://0.0.0.0:${PORT:-3000}