File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # Railway Optimized Dockerfile - Minimal Dependencies
1+ # Railway Optimized Dockerfile
22FROM 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
1212WORKDIR /app
1313
14- # Copy package files and use Railway-specific if available
14+ # Copy package files
1515COPY 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
2518RUN npm ci --omit=dev --no-audit --no-fund && \
2619 npm cache clean --force
2720
@@ -31,8 +24,8 @@ COPY . .
3124# Build the application
3225RUN 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
3831EXPOSE 3000
You can’t perform that action at this time.
0 commit comments