FROM node:20-alpine
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install all dependencies (including dev dependencies for build)
RUN npm ci
# Copy source code
COPY . .
# Build TypeScript
RUN npm run build
# Remove dev dependencies to reduce image size
RUN npm prune --production
# Expose port
EXPOSE 3000
# Start the server
CMD ["npm", "start"]