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
COPY . /usr/share/nginx/html
# Install simple static file server
RUN npm install -g serve
# Expose port 80
EXPOSE 80
# Create app directory
WORKDIR /app
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]
# Copy all files
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}