Files
september 54a81cbdcf init
2025-09-03 06:51:24 -07:00

28 lines
737 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM node:20-alpine AS builder
WORKDIR /app
# Копирование package.json и установка всех зависимостей
COPY package*.json ./
RUN npm ci
# Копирование исходного кода и сборка
COPY . .
RUN npm run build
# Production стадия с nginx
FROM nginx:alpine
# Удаление дефолтной конфигурации nginx
RUN rm /etc/nginx/conf.d/default.conf
# Копирование собранного приложения
COPY --from=builder /app/dist /usr/share/nginx/html
# Копирование кастомной конфигурации nginx для SPA
COPY nginx-spa.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]