Skip to content

Commit 6ba48b8

Browse files
committed
docs(og): record why process.cwd() is the app dir in the container
Review flagged the font path as invalid in the standalone image, reasoning that the container starts at the monorepo root. It does -- but Next's generated standalone server.js opens with process.chdir(__dirname), and that file ships beside public/. Same reason content/ is read this way at runtime.
1 parent 1d4282a commit 6ba48b8

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

apps/sim/app/(landing)/og-utils.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ function getTitleFontSize(title: string): number {
3636
* serves to browsers cannot be reused here.
3737
*
3838
* These live under `public/` so they need no `outputFileTracingIncludes` entry:
39-
* the Dockerfile copies that directory into the runner, which the
39+
* `docker/app.Dockerfile` copies that directory into the runner, which the
4040
* `force-dynamic` share-token card needs since it renders per request.
41+
*
42+
* `process.cwd()` is the app directory in every environment this runs in, not
43+
* just dev and build. The container starts at the monorepo root, but Next's
44+
* generated standalone `server.js` opens with `process.chdir(__dirname)`, and
45+
* that file ships beside `public/` — which is also why `content/` is read this
46+
* way at runtime.
4147
*/
4248
const FONT_DIR = join(process.cwd(), 'public', 'brand', 'fonts')
4349

0 commit comments

Comments
 (0)