feat: link migrations to payload config for production bundling and simplify dockerfile
All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 5s
Build & Deploy / 🧪 QA (push) Successful in 5m22s
Build & Deploy / 🏗️ Build (push) Successful in 7m24s
Build & Deploy / 🚀 Deploy (push) Successful in 11s
Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 3m39s
Build & Deploy / 🔔 Notify (push) Successful in 1s
All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 5s
Build & Deploy / 🧪 QA (push) Successful in 5m22s
Build & Deploy / 🏗️ Build (push) Successful in 7m24s
Build & Deploy / 🚀 Deploy (push) Successful in 11s
Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 3m39s
Build & Deploy / 🔔 Notify (push) Successful in 1s
This commit is contained in:
@@ -41,15 +41,8 @@ COPY . .
|
||||
# Build application
|
||||
RUN pnpm build
|
||||
|
||||
# Transpile migrations to JS for production compatibility (ESM requires extensions)
|
||||
RUN mkdir -p dist-migrations && \
|
||||
npx tsc migrations/*.ts --outDir dist-migrations --module esnext --target esnext --moduleResolution node --esModuleInterop --skipLibCheck || true && \
|
||||
cp migrations/*.json dist-migrations/ 2>/dev/null || true && \
|
||||
sed -i -E 's/(from|import) "\.\/([^"]*)"/\1 ".\/\2.js"/g' dist-migrations/index.js
|
||||
|
||||
# Stage 2: Runner
|
||||
FROM node:20-alpine AS runner
|
||||
# ... [skipping middle part as I'm replacing lines 45-64 in a single block] ...
|
||||
WORKDIR /app
|
||||
|
||||
# Install curl for health checks
|
||||
@@ -68,7 +61,6 @@ ENV NEXT_TELEMETRY_DISABLED=1
|
||||
# Copy standalone output and static files
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/dist-migrations ./migrations
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/cache ./.next/cache
|
||||
|
||||
|
||||
Reference in New Issue
Block a user