diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5d8bf8e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +node_modules +.next +.git +.env +.env.local +*.log +tests +docs +README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bb9bdda --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +# syntax=docker/dockerfile:1.7 + +# --- deps + build use the Bun image so we honor bun.lock --- +FROM oven/bun:1.3 AS deps +WORKDIR /app +COPY package.json bun.lock* ./ +RUN bun install --frozen-lockfile + +FROM oven/bun:1.3 AS build +WORKDIR /app +# Dummy DATABASE_URL so Next.js can collect page data at build time. +# The real value is injected at runtime via env vars. +ENV DATABASE_URL=postgres://build:build@localhost:5432/build +ENV NEXT_TELEMETRY_DISABLED=1 +COPY --from=deps /app/node_modules ./node_modules +COPY . . +RUN bun run build + +# --- runner: Playwright base image so the scraper has browsers available --- +FROM mcr.microsoft.com/playwright:v1.50.0-jammy AS runner +WORKDIR /app +ENV NODE_ENV=production +ENV PORT=3000 +COPY --from=build /app/.next/standalone ./ +COPY --from=build /app/.next/static ./.next/static +COPY --from=build /app/public ./public +COPY --from=build /app/drizzle ./drizzle +COPY --from=build /app/drizzle.config.ts ./ +COPY --from=build /app/src/lib/db/schema.ts ./schema.ts +EXPOSE 3000 +CMD ["node", "server.js"] diff --git a/public/.gitkeep b/public/.gitkeep new file mode 100644 index 0000000..e69de29