fix: archivos deploy

This commit is contained in:
2026-05-31 17:04:27 -05:00
parent b03c76dfeb
commit 1004707d8f
3 changed files with 14 additions and 7 deletions
+10 -3
View File
@@ -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
+1 -1
View File
@@ -40,7 +40,7 @@ sleep 10
RETRIES=5
while [ $RETRIES -gt 0 ]; do
if curl -sf http://localhost:3020/api/health > /dev/null 2>&1; then
if curl -sf http://localhost:3000/api/health > /dev/null 2>&1; then
echo "$(date '+%Y-%m-%d %H:%M:%S') - Deploy successful ✅" >> "$LOG_FILE"
exit 0
fi
+3 -3
View File
@@ -13,11 +13,11 @@ services:
- .env
environment:
- NODE_ENV=production
expose:
- "3020"
ports:
- "127.0.0.1:3020:3020"
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/api/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
start_period: 10s