fix static file serving path for docker deployment

This commit is contained in:
2026-03-21 21:45:51 +02:00
parent 3b5e4f8cc9
commit f09aa64f36

View File

@@ -168,10 +168,12 @@ export async function createServer() {
}, { prefix: "/api/v1" });
// serve static frontend build in production
const webDist = resolve(process.cwd(), "../web/dist");
if (process.env.NODE_ENV === "production" && existsSync(webDist)) {
const webDist = resolve(process.cwd(), "packages/web/dist");
const webDistAlt = resolve(process.cwd(), "../web/dist");
const staticRoot = existsSync(webDist) ? webDist : existsSync(webDistAlt) ? webDistAlt : null;
if (process.env.NODE_ENV === "production" && staticRoot) {
await app.register(fastifyStatic, {
root: webDist,
root: staticRoot,
wildcard: false,
});