Spaces:
Sleeping
Sleeping
File size: 534 Bytes
a7476ec | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # Stage 1: Build
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
# Install all dependencies including devDependencies for building
RUN npm install
COPY . .
# Build the TypeScript code
RUN npm run build
# Stage 2: Production
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
# Install only production dependencies
RUN npm ci --only=production
# Copy built assets from builder stage
COPY --from=builder /app/dist ./dist
# Expose the application port
EXPOSE 7860
# Start the server
CMD ["npm", "start"]
|