Skip to content

Commit 6730f61

Browse files
fix: make build verification fail-fast and set PORT=8080 for Railway
1 parent 20a0a4e commit 6730f61

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ COPY tsconfig*.json ./
1515
# Build ONLY frontend (not server)
1616
RUN npx vite build --config vite.config.ts
1717

18-
# Verify build output
19-
RUN ls -la /app/dist/public/ || echo "Build directory not found!"
18+
# Verify build output exists
19+
RUN ls -la /app/dist/public/ && echo "✅ Frontend build successful" || (echo "❌ Frontend build failed!" && exit 1)
2020

2121
# Production stage
2222
FROM node:20-alpine
@@ -35,12 +35,12 @@ COPY server/ ./
3535
COPY --from=frontend-builder /app/dist/public ./dist/public
3636

3737
# Verify copy worked
38-
RUN ls -la ./dist/public/ || echo "Frontend not copied!"
39-
RUN test -f ./dist/public/index.html && echo " index.html found" || echo " index.html missing"
38+
RUN ls -la ./dist/public/ && test -f ./dist/public/index.html && echo "✅ Frontend copied successfully" || (echo "❌ Frontend copy failed!" && exit 1)
4039

4140
# Environment
4241
ENV NODE_ENV=production
43-
EXPOSE 5000
42+
ENV PORT=8080
43+
EXPOSE 8080
4444

4545
# Run tsx
4646
CMD ["node_modules/.bin/tsx", "index.ts"]

0 commit comments

Comments
 (0)