fix: archivos deploy
This commit is contained in:
+10
-3
@@ -18,6 +18,14 @@ ENV NEXT_PUBLIC_SUPABASE_ANON_KEY=$NEXT_PUBLIC_SUPABASE_ANON_KEY
|
||||
|
||||
RUN npm run build
|
||||
|
||||
# Next.js standalone creates a subdirectory named after the project folder.
|
||||
# We flatten it to a known location so the runner doesn't depend on the name.
|
||||
RUN echo "=== Standalone output structure ===" && \
|
||||
ls -la /app/.next/standalone/ && \
|
||||
mkdir -p /app/.next/standalone-export && \
|
||||
cp -r /app/.next/standalone/*/ /app/.next/standalone-export/ && \
|
||||
ls -la /app/.next/standalone-export/
|
||||
|
||||
# ─── Stage 2: Production Runner ────────────────────────────────────────────
|
||||
FROM node:20-alpine AS runner
|
||||
WORKDIR /app
|
||||
@@ -30,9 +38,8 @@ ENV HOSTNAME=0.0.0.0
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
# Next.js standalone output includes a subdir named after the project.
|
||||
# Copy from standalone/cirux/ directly to /app
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone/cirux/ ./
|
||||
# Copy flattened standalone output (server.js is now directly in /app)
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone-export/ ./
|
||||
|
||||
# Copy static assets (images, fonts, etc.)
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
||||
|
||||
Reference in New Issue
Block a user