remove wrong props
This commit is contained in:
@@ -42,12 +42,14 @@ WORKDIR /app
|
|||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
ENV TRUST_PROXY=1
|
|
||||||
|
|
||||||
# Copy necessary files from builder stage
|
# Copy necessary files from builder stage
|
||||||
COPY --from=builder /app/.next/standalone ./
|
COPY --from=builder /app/.next/standalone ./
|
||||||
COPY --from=builder --chown=root:root /app/.next/static ./.next/static
|
COPY --from=builder --chown=root:root /app/.next/static ./.next/static
|
||||||
|
|
||||||
|
# Copy custom server.js that handles proxy headers
|
||||||
|
COPY --from=builder /app/server.js ./server.js
|
||||||
|
|
||||||
# Copy compiled database scripts instead of TypeScript sources
|
# Copy compiled database scripts instead of TypeScript sources
|
||||||
COPY --from=builder /app/dist ./dist
|
COPY --from=builder /app/dist ./dist
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,6 @@ const nextConfig = {
|
|||||||
output: process.env.NODE_ENV === 'production' ? 'standalone' : undefined,
|
output: process.env.NODE_ENV === 'production' ? 'standalone' : undefined,
|
||||||
// External packages for better SQLite3 compatibility (Next.js 15+ syntax)
|
// External packages for better SQLite3 compatibility (Next.js 15+ syntax)
|
||||||
serverExternalPackages: ['better-sqlite3'],
|
serverExternalPackages: ['better-sqlite3'],
|
||||||
// Trust proxy headers for Cloudflare tunnel
|
|
||||||
experimental: {
|
|
||||||
trustHost: true,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = nextConfig;
|
module.exports = nextConfig;
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
const { createServer } = require('http');
|
||||||
|
const { parse } = require('url');
|
||||||
|
const next = require('next');
|
||||||
|
|
||||||
|
const dev = process.env.NODE_ENV !== 'production';
|
||||||
|
const hostname = process.env.HOSTNAME || 'localhost';
|
||||||
|
const port = parseInt(process.env.PORT || '3000', 10);
|
||||||
|
|
||||||
|
const app = next({ dev, hostname, port });
|
||||||
|
const handle = app.getRequestHandler();
|
||||||
|
|
||||||
|
app.prepare().then(() => {
|
||||||
|
createServer((req, res) => {
|
||||||
|
// Trust proxy headers from Cloudflare tunnel
|
||||||
|
const proto = req.headers['x-forwarded-proto'];
|
||||||
|
if (proto === 'https') {
|
||||||
|
req.connection.encrypted = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const parsedUrl = parse(req.url, true);
|
||||||
|
handle(req, res, parsedUrl);
|
||||||
|
}).listen(port, hostname, (err) => {
|
||||||
|
if (err) throw err;
|
||||||
|
console.log(`> Ready on http://${hostname}:${port}`);
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user