Merge pull request 'feat/members-redesign' (#1) from feat/members-redesign into main
Reviewed-on: #1
This commit is contained in:
23
Dockerfile
23
Dockerfile
@@ -1,18 +1,15 @@
|
||||
FROM node:22-alpine AS base
|
||||
# node:22-slim (Debian/glibc) is ~2x faster for Next.js builds vs Alpine/musl
|
||||
FROM node:22-slim AS base
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
WORKDIR /app
|
||||
|
||||
# --- Install + Build in one stage ---
|
||||
# --- Install + Build ---
|
||||
FROM base AS builder
|
||||
# CACHE_BUST: change this value to force a full rebuild (busts Docker layer cache)
|
||||
ARG CACHE_BUST=14
|
||||
RUN echo "Cache bust: ${CACHE_BUST}"
|
||||
COPY . .
|
||||
RUN pnpm install --no-frozen-lockfile
|
||||
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
|
||||
pnpm install --no-frozen-lockfile --prefer-offline
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
# NEXT_PUBLIC_* vars are baked into the Next.js build at compile time.
|
||||
# Pass them as build args so the same Dockerfile works for any environment.
|
||||
ARG NEXT_PUBLIC_CI=false
|
||||
ARG NEXT_PUBLIC_SITE_URL=https://myeasycms.de
|
||||
ARG NEXT_PUBLIC_SUPABASE_URL=http://localhost:8000
|
||||
@@ -39,18 +36,18 @@ ENV NEXT_PUBLIC_ENABLE_PERSONAL_ACCOUNT_BILLING=${NEXT_PUBLIC_ENABLE_PERSONAL_AC
|
||||
ENV NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_BILLING=${NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_BILLING}
|
||||
RUN pnpm --filter web build
|
||||
|
||||
# --- Run ---
|
||||
FROM base AS runner
|
||||
# --- Run (slim for smaller image than full Debian) ---
|
||||
FROM node:22-slim AS runner
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
COPY --from=builder /app/ ./
|
||||
|
||||
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs
|
||||
|
||||
# Ensure Next.js cache directories are writable by the nextjs user
|
||||
RUN groupadd --system --gid 1001 nodejs && useradd --system --uid 1001 --create-home nextjs
|
||||
RUN mkdir -p /app/apps/web/.next/cache && chown -R nextjs:nodejs /app/apps/web/.next/cache
|
||||
RUN mkdir -p /home/nextjs/.cache/node/corepack && chown -R nextjs:nodejs /home/nextjs/.cache
|
||||
|
||||
USER nextjs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user