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
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
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -42,9 +42,10 @@ COPY . .
|
||||
RUN pnpm build
|
||||
|
||||
# Transpile migrations to JS for production compatibility (ESM requires extensions)
|
||||
RUN npx tsc migrations/*.ts --outDir migrations --module esnext --target esnext --moduleResolution node --esModuleInterop --skipLibCheck || true && \
|
||||
sed -i 's/from "\.\/\([^"]*\)";/from ".\/\1.js";/g' migrations/index.js && \
|
||||
rm migrations/*.ts
|
||||
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
|
||||
@@ -67,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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user