From 3500acf253ab71248c854ff148515b58d9d1fa57 Mon Sep 17 00:00:00 2001 From: artem Date: Fri, 18 Sep 2026 23:48:40 +0300 Subject: [PATCH] ssr --- Dockerfile | 2 ++ server/template.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cd9747c..ce7d12b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,4 +31,6 @@ RUN rm -f /etc/nginx/conf.d/default.conf EXPOSE 80 +ENV DIST_PATH=/usr/share/nginx/html + CMD ["sh", "-c", "npx tsx server/index.ts & nginx -g 'daemon off;'"] diff --git a/server/template.ts b/server/template.ts index 9ae7a43..e398393 100644 --- a/server/template.ts +++ b/server/template.ts @@ -20,7 +20,8 @@ export interface TemplateOptions { * This ensures we always reference the correct hashed asset filenames. */ export function getAssetTags(): string { - const distIndex = path.resolve(__dirname, "../dist/index.html"); + const distPath = process.env.DIST_PATH || path.resolve(__dirname, "../dist"); + const distIndex = path.join(distPath, "index.html"); const html = fs.readFileSync(distIndex, "utf-8"); const scriptMatch = html.match(/]*src="[^"]*"[^>]*><\/script>/g); const linkMatch = html.match(/]*rel="stylesheet"[^>]*>/g);