Skip to content

Commit 849a4c2

Browse files
azdanovvnepogodin
andauthored
feat(app): show version (#41)
* feat(app): show app version * refactor: add default app version * fix: typo Co-authored-by: Vladislav Nepogodin <[email protected]> * ci: expand build to include args --------- Co-authored-by: Vladislav Nepogodin <[email protected]>
1 parent c6f53ca commit 849a4c2

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Base image
2-
FROM oven/bun:1.2-slim as base
2+
FROM oven/bun:1.2-slim AS base
33
WORKDIR /app
44

55
# Dependencies
6-
FROM base as deps
6+
FROM base AS deps
77

88
WORKDIR /app
99

@@ -12,9 +12,10 @@ COPY package.json bun.lock ./
1212
RUN bun --bun install
1313

1414
# Build
15-
FROM base as build
15+
FROM base AS build
1616
COPY --from=deps /app/node_modules ./node_modules
1717
COPY . .
18+
ARG NEXT_PUBLIC_APP_VERSION=production
1819
RUN bun --bun run build
1920

2021
# Production

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ To build the Docker image, run the following command from the root directory:
6565
docker build -t public-repo-dashboard .
6666
```
6767

68+
An optional `--build-arg NEXT_PUBLIC_APP_VERSION=$(git rev-parse --short HEAD)` can be used to include the current Git commit in the dashboard's `<meta>` tag during the build.
69+
6870
### Run the Docker Container
6971
7072
To run the Docker container, use the following command:

docker-compose.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
services:
22
public-repo-dashboard:
3-
build: .
3+
build:
4+
context: .
5+
args:
6+
- NEXT_PUBLIC_APP_VERSION=latest
47
container_name: public-repo-dashboard
58
environment:
69
# This should match the API service URL.

src/app/layout.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ const geistMono = Geist_Mono({
1818
});
1919

2020
export const metadata: Metadata = {
21+
other: {
22+
version: process.env.NEXT_PUBLIC_APP_VERSION || 'development',
23+
},
2124
title: {
2225
default: 'CachyOS',
2326
template: 'CachyOS | %s ',

0 commit comments

Comments
 (0)