- backend/Dockerfile: alpine→slim, add NODE_TLS_REJECT_UNAUTHORIZED=0, 3-stage pattern - web/Dockerfile: alpine→slim, add NODE_TLS_REJECT_UNAUTHORIZED=0, remove non-existent public/ COPY - web/next.config.ts: add transpilePackages + webpack symlinks for pnpm @bytelyst/* resolution Docker smoke tests: backend + web builds pass
52 lines
1.0 KiB
TypeScript
52 lines
1.0 KiB
TypeScript
import path from "node:path";
|
|
import type { NextConfig } from "next";
|
|
|
|
const securityHeaders = [
|
|
{
|
|
key: "X-Frame-Options",
|
|
value: "DENY",
|
|
},
|
|
{
|
|
key: "X-Content-Type-Options",
|
|
value: "nosniff",
|
|
},
|
|
{
|
|
key: "Referrer-Policy",
|
|
value: "strict-origin-when-cross-origin",
|
|
},
|
|
{
|
|
key: "Permissions-Policy",
|
|
value: "camera=(), microphone=(), geolocation=()",
|
|
},
|
|
];
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: "standalone",
|
|
outputFileTracingRoot: path.join(process.cwd(), ".."),
|
|
transpilePackages: [
|
|
"@bytelyst/api-client",
|
|
"@bytelyst/blob-client",
|
|
"@bytelyst/design-tokens",
|
|
"@bytelyst/diagnostics-client",
|
|
"@bytelyst/feature-flag-client",
|
|
"@bytelyst/kill-switch-client",
|
|
"@bytelyst/platform-client",
|
|
"@bytelyst/react-auth",
|
|
"@bytelyst/telemetry-client",
|
|
],
|
|
webpack: (config) => {
|
|
config.resolve.symlinks = true;
|
|
return config;
|
|
},
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: "/(.*)",
|
|
headers: securityHeaders,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|