Files
doormile_app_web/Dockerfile
2026-06-11 21:29:16 +05:30

27 lines
553 B
Docker

# Stage 1: Build the React application
FROM node:20-alpine AS build
WORKDIR /app
# Copy lock files and install dependencies
COPY package*.json yarn.lock* package-lock.json* ./
RUN npm install
# Copy codebase and compile Vite project
COPY . .
RUN npm run build
# Stage 2: Serve using Nginx
FROM nginx:alpine
# Copy custom Nginx configuration
COPY nginx.config /etc/nginx/nginx.conf
# Copy Vite's dist output from Stage 1 to Nginx default html path
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 3000
CMD ["nginx", "-g", "daemon off;"]