WhiteNightsAdminPanel/Dockerfile
itoshi b1a4edc136
All checks were successful
release-tag / release-image (push) Successful in 2m18s
fix: Try to fix dockerfile
2025-05-25 20:20:09 +03:00

45 lines
1.2 KiB
Docker

# This Dockerfile uses `serve` npm package to serve the static files with node process.
# You can find the Dockerfile for nginx in the following link:
# https://github.com/refinedev/dockerfiles/blob/main/vite/Dockerfile.nginx
FROM refinedev/node:20 AS base
FROM base AS deps
# Копируем только файлы зависимостей
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./
RUN \
if [ -f yarn.lock ]; then yarn install --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then npm install -g pnpm && pnpm install --frozen-lockfile; \
else echo "❌ Lockfile not found." && exit 1; \
fi
FROM base AS builder
ENV NODE_ENV=production
# Обязательно создать рабочую директорию
WORKDIR /app/refine
COPY --from=deps /app/refine/node_modules ./node_modules
COPY . .
# Добавлена проверка и вывод логов
RUN echo "🚧 Starting build..." && npm run build || (echo "❌ Build failed" && exit 1)
FROM base AS runner
ENV NODE_ENV=production
RUN npm install -g serve
WORKDIR /app/refine
COPY --from=builder /app/refine/dist ./
USER refine
CMD ["serve", "-s", ".", "-l", "3000"]