update docker files

This commit is contained in:
2025-11-09 22:30:11 +03:00
parent 9699cb51d4
commit c46f899e10
3 changed files with 10 additions and 18 deletions

View File

@@ -1,33 +1,25 @@
# Multi-stage build for production
# Stage 1: Build the React application
# Stage 1: Build the Vite application
FROM node:20-alpine AS build
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json yarn.lock ./
# Install dependencies
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
# Copy source code
# Copy source code and build
COPY . .
# Build the application for production
RUN yarn build
# Stage 2: Serve with nginx
FROM nginx:alpine
FROM nginx:1.27-alpine
# Copy custom nginx configuration
# Copy nginx configuration tuned for a single-page application
COPY nginx.conf /etc/nginx/nginx.conf
# Copy built application from build stage
COPY --from=build /app/build /usr/share/nginx/html
# Copy built assets
COPY --from=build /app/dist /usr/share/nginx/html
# Expose port 80
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]