dockerfile now logs git commit hash

This commit is contained in:
corgifist 2025-07-28 19:58:07 +03:00
parent 01524ca4ce
commit ad39e0d557
3 changed files with 16 additions and 9 deletions

View File

@ -13,8 +13,13 @@ const gitCommitHash = generateGitCommitHash();
const nextConfig: NextConfig = {
output: "standalone",
generateBuildId: () => gitCommitHash,
env: {
BUILD_ID_ENV: gitCommitHash
webpack: (config, { webpack, buildId, isServer }) => {
config.plugins.push(
new webpack.DefinePlugin({
'process.env.BUILD_ID_ENV': JSON.stringify(buildId)
})
);
return config;
}
};

View File

@ -38,6 +38,8 @@ ENV NEXT_TELEMETRY_DISABLED=1
ARG GIT_COMMIT
ENV GIT_COMMIT=$GIT_COMMIT
RUN echo ${GIT_COMMIT}
RUN \
if [ -f yarn.lock ]; then yarn run build; \
elif [ -f package-lock.json ]; then npm run build; \

View File

@ -10,6 +10,7 @@ import AscendingCard from "@/components/ascending-card";
import Link from "next/link";
import WideContainer from "@/components/wide-container";
export default function Settings(): ReactNode {
const isMobile = useIsMobile();
@ -28,9 +29,9 @@ export default function Settings(): ReactNode {
</WideContainer>
</SidebarTriggerAdjustable>
</div>
<div className="flex flex-col items-center w-full">
<div className="flex flex-col gap-1 md:gap-2 mt-1 md:mt-2">
<WideContainer>
<div className="flex flex-col justify-center items-center">
<WideContainer>
<div className="flex flex-col gap-1 md:gap-2 mt-1 md:mt-2 justify-center">
<Link href="/settings/storage">
<AscendingCard className="flex flex-row justify-between gap-2 p-4">
<div className="flex flex-row justify-between items-center gap-3">
@ -45,10 +46,9 @@ export default function Settings(): ReactNode {
<ChevronRightIcon />
</AscendingCard>
</Link>
</WideContainer>
<p className="text-sm text-muted-foreground">Build ID: {process.env.BUILD_ID_ENV}</p>
</div>
<p className="text-sm text-muted-foreground">Build ID: {process.env.BUILD_ID_ENV}</p>
</div>
</WideContainer>
</div>
</div>
);