Skip to content

Commit 7a7681e

Browse files
fix: Simplify Dockerfile to fix build error
1 parent a2d52ce commit 7a7681e

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

Dockerfile

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Railway Optimized Dockerfile - Minimal Dependencies
1+
# Railway Optimized Dockerfile
22
FROM node:20-slim
33

44
# Install dependencies for build
@@ -11,17 +11,10 @@ RUN apt-get update && apt-get install -y \
1111
# Set working directory
1212
WORKDIR /app
1313

14-
# Copy package files and use Railway-specific if available
14+
# Copy package files
1515
COPY package*.json ./
16-
COPY package.railway.json ./package.railway.json 2>/dev/null || true
1716

18-
# Use Railway package.json if it exists (minimal dependencies)
19-
RUN if [ -f "package.railway.json" ]; then \
20-
echo "Using Railway-specific package.json"; \
21-
mv package.railway.json package.json; \
22-
fi
23-
24-
# Install only production dependencies
17+
# Install dependencies
2518
RUN npm ci --omit=dev --no-audit --no-fund && \
2619
npm cache clean --force
2720

@@ -31,8 +24,8 @@ COPY . .
3124
# Build the application
3225
RUN npm run build
3326

34-
# Clean up build dependencies
35-
RUN rm -rf src/ scripts/ test/ tests/ __tests__ *.test.* *.spec.*
27+
# Clean up build dependencies and unnecessary files
28+
RUN rm -rf src/ scripts/ test/ tests/ __tests__ *.test.* *.spec.* node_modules/.cache
3629

3730
# Expose port
3831
EXPOSE 3000

0 commit comments

Comments
 (0)