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,