fix: port 3000 > 3020, APP_DIR /opt/cirux > /home/ubuntu/cirux
This commit is contained in:
+10
-7
@@ -18,13 +18,16 @@ 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 ===" && \
|
||||
# Flatten standalone output — find the single subdir Next.js creates
|
||||
RUN set -e && \
|
||||
echo "=== Standalone output ===" && \
|
||||
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/
|
||||
STANDALONE_DIR=$(find /app/.next/standalone -maxdepth 1 -mindepth 1 -type d | head -1) && \
|
||||
echo "Copying from: $STANDALONE_DIR" && \
|
||||
cp -r "$STANDALONE_DIR"/* /app/.next/standalone-export/ && \
|
||||
ls -la /app/.next/standalone-export/ && \
|
||||
test -f /app/.next/standalone-export/server.js && echo "✅ server.js found" || (echo "❌ server.js NOT FOUND" && exit 1)
|
||||
|
||||
# ─── Stage 2: Production Runner ────────────────────────────────────────────
|
||||
FROM node:20-alpine AS runner
|
||||
@@ -38,10 +41,10 @@ ENV HOSTNAME=0.0.0.0
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
# Copy flattened standalone output (server.js is now directly in /app)
|
||||
# Copy flattened standalone output (server.js directly in /app)
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone-export/ ./
|
||||
|
||||
# Copy static assets (images, fonts, etc.)
|
||||
# Copy static assets
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
|
||||
|
||||
Reference in New Issue
Block a user