From c8458ec79ca75a42760fb06e5a672f549a07d23f Mon Sep 17 00:00:00 2001 From: tinkle-community Date: Tue, 6 Jan 2026 18:53:27 +0800 Subject: [PATCH] fix: align PORT defaults to 8080 for Railway --- Dockerfile.railway | 6 +++--- railway/start.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile.railway b/Dockerfile.railway index b5d307aa..27bc02f7 100644 --- a/Dockerfile.railway +++ b/Dockerfile.railway @@ -33,11 +33,11 @@ COPY railway/start.sh /app/start.sh RUN chmod +x /app/start.sh ENV DB_PATH=/app/data/data.db -ENV PORT=3000 -EXPOSE 3000 +# Railway 会自动设置 PORT 环境变量 +EXPOSE 8080 HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ - CMD wget --no-verbose --tries=1 --spider http://localhost:${PORT:-3000}/health || exit 1 + CMD wget --no-verbose --tries=1 --spider http://localhost:${PORT:-8080}/health || exit 1 CMD ["/app/start.sh"] diff --git a/railway/start.sh b/railway/start.sh index e82ca17c..12beb1fe 100644 --- a/railway/start.sh +++ b/railway/start.sh @@ -1,8 +1,8 @@ #!/bin/sh set -e -# 默认端口 -export PORT=${PORT:-3000} +# 默认端口(Railway 会设置 PORT=8080) +export PORT=${PORT:-8080} echo "🚀 Starting NOFX on port $PORT..." # 生成加密密钥(如果没有设置)