Files
Proxmox-VPS-Panel/frontend/Dockerfile
T
2026-07-25 03:36:08 +03:00

32 lines
983 B
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.
# --- deps: устанавливаем только React-зависимости ---
FROM node:20-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json* ./
# npm ci требует lock-файл; если его нет — fallback на npm install.
RUN if [ -f package-lock.json ]; then \
npm ci --no-audit --no-fund; \
else \
npm install --no-audit --no-fund; \
fi
# --- build: Vite-сборка поверх deps ---
FROM deps AS build
WORKDIR /app
COPY . .
RUN npm run build
# --- runtime: nginx + артефакты Vite ---
FROM nginx:1.27-alpine
# Конфигурация nginx.
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Собранный фронтенд.
COPY --from=build /app/dist /usr/share/nginx/html
# В нашем nginx.conf прописан listen 5173 — порт публикует compose.
EXPOSE 5173
HEALTHCHECK --interval=15s --timeout=5s --retries=3 \
CMD wget -q --spider http://localhost:5173/ || exit 1