modified: main_dc/yalarba/easySite/easySite/Dockerfile
multystage builder for easysite102.ru
This commit is contained in:
@@ -1,21 +1,27 @@
|
||||
FROM node:20-alpine
|
||||
# syntax = docker/dockerfile:1
|
||||
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN --mount=type=cache,target=/root/.npm npm ci --prefer-offline
|
||||
|
||||
COPY nuxt.config.ts ./
|
||||
COPY tsconfig.json ./
|
||||
|
||||
# Увеличиваем память
|
||||
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
||||
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
|
||||
# Собираем без таймаута
|
||||
RUN npm run build
|
||||
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/.output ./output
|
||||
COPY --from=builder /app/package*.json ./
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm npm install --only=production
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["node", ".output/server/index.mjs"]
|
||||
Reference in New Issue
Block a user