Update Dockerfile and package.json for proper TypeScript build and deployment

This commit is contained in:
Your Name
2025-04-29 13:16:21 -04:00
parent eb2d967fd4
commit d2f30f528e
2 changed files with 33 additions and 9 deletions

View File

@@ -1,5 +1,7 @@
FROM node:18-alpine
# Build stage
FROM node:18-alpine AS builder
# Set working directory
WORKDIR /app
# Copy package files
@@ -12,10 +14,30 @@ RUN cd frontend && npm install
# Copy source files
COPY . .
COPY frontend ./frontend
# Build frontend
RUN cd frontend && npm run build
# Build backend
RUN npm run build
# Production stage
FROM node:18-alpine
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install production dependencies only
RUN npm install --production
# Copy built files from builder stage
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/frontend/build ./frontend/build
# Expose port
EXPOSE 3000