dockerfile update
This commit is contained in:
+4
-17
@@ -24,6 +24,7 @@ COPY package.json pnpm-lock.yaml* ./
|
|||||||
RUN --mount=type=cache,target=/root/.local/share/pnpm/store \
|
RUN --mount=type=cache,target=/root/.local/share/pnpm/store \
|
||||||
pnpm install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
# --- Stage 2: Сборка Next.js ---
|
||||||
# --- Stage 2: Сборка Next.js ---
|
# --- Stage 2: Сборка Next.js ---
|
||||||
FROM node:20-alpine AS builder
|
FROM node:20-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -35,22 +36,8 @@ COPY . .
|
|||||||
COPY --from=wasm-builder /build/matrix-engine/pkg/matrix_engine_bg.wasm ./public/wasm-matrix/
|
COPY --from=wasm-builder /build/matrix-engine/pkg/matrix_engine_bg.wasm ./public/wasm-matrix/
|
||||||
COPY --from=wasm-builder /build/matrix-engine/pkg/matrix_engine.js ./public/wasm-matrix/
|
COPY --from=wasm-builder /build/matrix-engine/pkg/matrix_engine.js ./public/wasm-matrix/
|
||||||
|
|
||||||
|
# 👇 ДОБАВЬ ЭТУ СТРОКУ 👇
|
||||||
|
RUN cp matrix-engine/matrix_worker.js public/wasm-matrix/
|
||||||
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
RUN pnpm run build
|
RUN pnpm run build
|
||||||
|
|
||||||
# --- Stage 3: Продакшен сервер ---
|
|
||||||
FROM node:20-alpine AS runner
|
|
||||||
WORKDIR /app
|
|
||||||
ENV NODE_ENV=production
|
|
||||||
|
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
|
||||||
RUN adduser --system --uid 1001 nextjs
|
|
||||||
USER nextjs
|
|
||||||
|
|
||||||
COPY --from=builder /app/public ./public
|
|
||||||
COPY --from=builder /app/.next ./.next
|
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
|
||||||
COPY --from=builder /app/package.json ./package.json
|
|
||||||
|
|
||||||
EXPOSE 3000
|
|
||||||
CMD ["npm", "start"]
|
|
||||||
Reference in New Issue
Block a user