From f4301428c77d1b5d7852421e2fe2e9214d1494c2 Mon Sep 17 00:00:00 2001 From: Sepehr Yahyaee Date: Fri, 19 Jun 2026 15:05:35 +0330 Subject: [PATCH] ServeRoot fixing on WORKDIR --- src/app.module.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app.module.ts b/src/app.module.ts index 2ac0478..722909f 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -32,7 +32,11 @@ import { AppConfigModule } from "./core/config/config.module"; DatabaseModule, CronModule, ServeStaticModule.forRoot({ - rootPath: join(__dirname, "..", "files"), + // process.cwd() is always the project/container root (/app in Docker), + // so the volume-mounted /app/files is resolved correctly regardless of + // where the compiled dist files live (__dirname would resolve to + // /app/dist/src because TypeScript preserves the src/ prefix in outDir). + rootPath: join(process.cwd(), "files"), serveRoot: "/files", }), UsersModule,