Document_Query / next.config.ts
Reubencf's picture
Deploy Next.js Query Bot as Docker Space
ff0e173
Raw
History Blame Contribute Delete
1.18 kB
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// Emit a self-contained server bundle (.next/standalone) so the Docker
// image used by the Hugging Face Space stays small and runs with `node server.js`.
output: 'standalone',
// Pin the workspace root to this project. A stray lockfile higher up the
// drive (E:\pnpm-lock.yaml) otherwise makes Next infer E:\ as the root and
// nest the standalone output under a query-bot/ subdir, breaking the image.
outputFileTracingRoot: __dirname,
turbopack: {
root: __dirname,
},
transpilePackages: ['motion'],
// Keep these Node-only parsers/SDK out of the server bundle so their
// dynamic requires (pdf.js worker, native bits) resolve at runtime.
serverExternalPackages: ['pdf-parse', 'mammoth', 'xlsx', 'cohere-ai'],
// Allow the brand file-type icons served from icons8 to flow through
// the next/image optimizer. The query string carries the icon id, so
// `search` is omitted to permit it.
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'img.icons8.com',
pathname: '/**',
},
],
},
};
export default nextConfig;