Fix docs path resolution in container

This commit is contained in:
2026-04-21 10:35:22 -04:00
parent 55e4f18509
commit df2f4b2e2a
+3 -1
View File
@@ -44,7 +44,9 @@ const BASE_URL = process.env.BASE_URL || `http://localhost:${PORT}`;
const isProd = process.env.NODE_ENV === 'production';
const trustProxy = process.env.TRUST_PROXY === '1' || process.env.TRUST_PROXY === 'true';
const isMemoryDb = !process.env.DATABASE_URL || process.env.DATABASE_URL.startsWith('memory://');
const appRoot = process.env.APP_ROOT || fileURLToPath(new URL('../../', import.meta.url));
// appRoot should resolve to the repo root inside the container (typically /app)
// index.js lives at /app/src/index.js, so ../ is the correct root.
const appRoot = process.env.APP_ROOT || fileURLToPath(new URL('../', import.meta.url));
const dataRoot = process.env.DATA_DIR || path.join(appRoot, 'data');
if (trustProxy) app.set('trust proxy', 1);