update docker file

This commit is contained in:
2025-11-09 22:46:32 +03:00
parent c46f899e10
commit 78eef4c462
4 changed files with 10 additions and 99 deletions

View File

@@ -1,28 +1,19 @@
# Use Node.js 20 Alpine as base image for smaller size
FROM node:20-alpine
FROM node:20-alpine AS builder
# Set working directory
WORKDIR /app
# Install dependencies for node-gyp and other native modules
RUN apk add --no-cache python3 make g++
# Copy package files
COPY package.json yarn.lock ./
RUN corepack enable && yarn install --frozen-lockfile
# Install dependencies
RUN yarn install --frozen-lockfile
# Copy source code
COPY . .
RUN yarn build
# Expose Vite dev server port
EXPOSE 5173
FROM nginx:1.27-alpine
# Set environment variables for development
ENV NODE_ENV=development
ENV CHOKIDAR_USEPOLLING=true
ENV WATCHPACK_POLLING=true
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
# Start the development server
CMD ["yarn", "dev", "--host", "0.0.0.0"]