Skip to content

Commit b9a353e

Browse files
Simplify to tsx directly with explicit binary path and add verbose startup logging
1 parent f2df3b5 commit b9a353e

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
WORKDIR /app
44

5-
# Copy server package files
5+
# Copy server package files and install dependencies
66
COPY server/package*.json ./
7-
RUN npm install --production
7+
RUN npm install --production && npm list tsx
88

9-
# Copy server source
9+
# Copy source code
1010
COPY server/ ./
1111
COPY shared/ ./shared/
1212

1313
# Environment
1414
ENV NODE_ENV=production
1515
EXPOSE 5000
1616

17-
# Start using tsx
18-
CMD ["npm", "start"]
17+
# Start with explicit path to tsx
18+
CMD ["./node_modules/.bin/tsx", "index.ts"]

server/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@
33
* Production-ready, no Vite dependencies
44
*/
55

6+
console.log('========================================');
7+
console.log('🚀 SERVER STARTING - index.ts loaded');
8+
console.log('Node version:', process.version);
9+
console.log('========================================');
10+
611
// Try to load .env if it exists (local dev), but don't fail if it doesn't (Railway)
712
try {
813
await import('dotenv/config');
9-
} catch {
10-
// Railway doesn't need dotenv - env vars are injected directly
14+
console.log('✅ dotenv loaded');
15+
} catch (e) {
16+
console.log('ℹ️ No dotenv (Railway mode)');
1117
}
1218

1319
// Log startup environment AND all environment variables to debug Railway

server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"dev": "tsx index.ts",
88
"build": "echo 'No build needed - using tsx runtime'",
9-
"start": "node --loader tsx --no-warnings index.ts"
9+
"start": "tsx index.ts"
1010
},
1111
"dependencies": {
1212
"@solana/spl-token": "^0.4.8",

0 commit comments

Comments
 (0)