Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ea8bd46973 | |||
| ff269b1f84 | |||
| afa586c833 |
@@ -41,8 +41,14 @@ COPY . .
|
|||||||
# Build application
|
# Build application
|
||||||
RUN pnpm build
|
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
|
||||||
|
|
||||||
# Stage 2: Runner
|
# Stage 2: Runner
|
||||||
FROM node:20-alpine AS runner
|
FROM node:20-alpine AS runner
|
||||||
|
# ... [skipping middle part as I'm replacing lines 45-64 in a single block] ...
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install curl for health checks
|
# Install curl for health checks
|
||||||
@@ -61,7 +67,8 @@ ENV NEXT_TELEMETRY_DISABLED=1
|
|||||||
# Copy standalone output and static files
|
# Copy standalone output and static files
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
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/.next/standalone ./
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/migrations ./migrations
|
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/.next/static ./.next/static
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/cache ./.next/cache
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/cache ./.next/cache
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user