Files
news_all_spo/web-react/Dockerfile
2026-05-15 03:31:28 +05:00

23 lines
1.0 KiB
Docker
Raw 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.
# ── Шаг 1: сборка основного React-приложения ──────────────────────────────────
FROM node:20-alpine AS app-build
WORKDIR /build
COPY web-react/package*.json ./
RUN npm ci --prefer-offline
COPY web-react/ ./
RUN npm run build
# ── Шаг 2: сборка редактора статей (TipTap) ───────────────────────────────────
FROM node:20-alpine AS editor-build
WORKDIR /build
COPY web/editor-ui/package*.json ./
RUN npm ci --prefer-offline
COPY web/editor-ui/ ./
RUN npm run build
# ── Шаг 3: nginx раздаёт оба приложения ───────────────────────────────────────
FROM nginx:alpine
COPY --from=app-build /build/dist /usr/share/nginx/html/app
COPY --from=editor-build /build/dist /usr/share/nginx/html/editor
COPY web-react/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80