Skip to content

Commit ccdf499

Browse files
Fix: Use node --import tsx for proper module resolution
1 parent 2cba474 commit ccdf499

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

Dockerfile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
FROM node:20-alpine
22

3-
# Set up monorepo structure
3+
# Create workspace structure
44
WORKDIR /workspace
55

6-
# Copy server package files and install dependencies
6+
# Copy shared first
7+
COPY shared/ ./shared/
8+
9+
# Copy server package files
710
COPY server/package*.json ./server/
811
WORKDIR /workspace/server
12+
13+
# Install dependencies
914
RUN npm install --production
1015

11-
# Copy all source code
16+
# Copy server source
1217
WORKDIR /workspace
1318
COPY server/ ./server/
14-
COPY shared/ ./shared/
1519

16-
# Set working directory to server
20+
# Set final working directory
1721
WORKDIR /workspace/server
1822

1923
# Environment
2024
ENV NODE_ENV=production
25+
ENV TSX_TSCONFIG_PATH=/workspace/server/tsconfig.json
2126
EXPOSE 5000
2227

23-
# Run tsx directly
24-
CMD ["node_modules/.bin/tsx", "index.ts"]
28+
# Run tsx with proper node options
29+
CMD ["node", "--import", "tsx", "index.ts"]

0 commit comments

Comments
 (0)