This commit is contained in:
+6
-7
@@ -15,13 +15,12 @@ FROM node:20-alpine AS base
|
||||
WORKDIR /app
|
||||
|
||||
FROM base AS deps
|
||||
# RUN apk add --no-cache libc6-compat git
|
||||
RUN apk add --no-cache libc6-compat
|
||||
COPY package*.json ./
|
||||
RUN --mount=type=cache,target=/root/.npm \
|
||||
npm ci --legacy-peer-deps --ignore-scripts --loglevel info
|
||||
npm ci --legacy-peer-deps --loglevel info
|
||||
|
||||
FROM base AS builder
|
||||
WORKDIR /build
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
@@ -35,10 +34,10 @@ ENV NEXT_TELEMETRY_DISABLED=1
|
||||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||
RUN mkdir .next && chown appuser:appgroup .next
|
||||
|
||||
COPY --from=builder --chown=appuser:appgroup /build/.next/standalone ./
|
||||
COPY --from=builder --chown=appuser:appgroup /build/.next/static ./.next/static
|
||||
COPY --from=builder --chown=appuser:appgroup /build/public ./public
|
||||
COPY --from=builder --chown=appuser:appgroup /build/package.json ./package.json
|
||||
COPY --from=builder --chown=appuser:appgroup /app/.next/standalone ./
|
||||
COPY --from=builder --chown=appuser:appgroup /app/.next/static ./.next/static
|
||||
COPY --from=builder --chown=appuser:appgroup /app/public ./public
|
||||
COPY --from=builder --chown=appuser:appgroup /app/package.json ./package.json
|
||||
|
||||
USER appuser
|
||||
|
||||
|
||||
Reference in New Issue
Block a user