add Docker configuration for containerization

This commit is contained in:
ahmadrezabd
2025-11-19 18:16:17 +03:30
parent 948238b6d9
commit db5fc8f636
5 changed files with 197 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy source code
COPY . .
# Build the application
RUN npm run build
# Production stage
FROM nginx:alpine
# Copy built files from builder stage
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]