From a1d849092b61b30ba185a38d3f1cb8f59fb2eba7 Mon Sep 17 00:00:00 2001 From: SrIzan10 <66965250+SrIzan10@users.noreply.github.com> Date: Mon, 30 Jun 2025 12:21:58 +0000 Subject: [PATCH] fix: dockerfile stuff --- apps/web/Dockerfile | 3 +++ apps/web/next.config.mjs | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile index cdea0b4..fb65f48 100644 --- a/apps/web/Dockerfile +++ b/apps/web/Dockerfile @@ -34,6 +34,9 @@ WORKDIR /app RUN apk add --no-cache ffmpeg +ARG commit=0 +ENV commit=$commit + # Don't run production as root RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index e1fc081..57bdb57 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -1,6 +1,7 @@ import * as path from 'node:path'; import { fileURLToPath } from 'url'; import { readFileSync } from 'node:fs'; +import { execSync } from 'node:child_process'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); @@ -12,7 +13,8 @@ const LIVE_SERVER_URL = const packageJson = JSON.parse(readFileSync('./package.json', 'utf8')); const { version } = packageJson; -const commit = process.env.commit || process.env.NEXT_PUBLIC_COMMIT || 'unknown'; +const commit = process.env.commit || execSync('git rev-parse --short HEAD') + .toString().trim(); /** @type {import('next').NextConfig} */ const nextConfig = { images: {