2 Commits

Author SHA1 Message Date
855390a27b fix(deploy): use dedicated dist-migrations dir and fix sed path in Dockerfile
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 4s
Build & Deploy / 🧪 QA (push) Successful in 4m28s
Build & Deploy / 🏗️ Build (push) Successful in 2m55s
Build & Deploy / 🚀 Deploy (push) Failing after 31s
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 1s
2026-03-11 00:46:10 +01:00
ea8bd46973 fix(deploy): add .js extensions to transpiled migration imports for ESM compatibility
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 7s
Build & Deploy / 🧪 QA (push) Successful in 5m30s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🏗️ Build (push) Failing after 3m20s
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
2026-03-11 00:38:23 +01:00

View File

@@ -41,8 +41,11 @@ COPY . .
# Build application
RUN pnpm build
# Transpile migrations for production runner
RUN pnpm exec tsc migrations/*.ts --outDir migrations_built --module esnext --target esnext --moduleResolution node --esModuleInterop --skipLibCheck || true
# 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 's/from "\.\/\([^"]*\)";/from ".\/\1.js";/g' dist-migrations/index.js
# Stage 2: Runner
FROM node:20-alpine AS runner
@@ -65,8 +68,7 @@ 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/migrations_built ./migrations
COPY --from=builder --chown=nextjs:nodejs /app/migrations/*.json ./migrations/
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