From 55e3cf504282f48e4a175927e6ad95336924f967 Mon Sep 17 00:00:00 2001 From: Daniel Bedeleanu Date: Mon, 13 Apr 2026 19:50:28 +0300 Subject: [PATCH] Build [v1.8.5] (Self-contained Frontend Build) --- VERSION.json | 5 ----- docker-compose.yml | 3 +-- export_prod.sh | 8 ++++---- frontend/Dockerfile | 7 +++---- frontend/VERSION.json | 5 +++++ frontend/app/page.tsx | 2 +- scripts/save_version.py | 2 +- 7 files changed, 15 insertions(+), 17 deletions(-) delete mode 100644 VERSION.json create mode 100644 frontend/VERSION.json diff --git a/VERSION.json b/VERSION.json deleted file mode 100644 index 30104a0f..00000000 --- a/VERSION.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "version": "1.8.4", - "last_build": "2026-04-13-1945", - "codename": "ConfigSync" -} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c7937481..55b80718 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,8 +23,7 @@ services: frontend: build: - context: . - dockerfile: frontend/Dockerfile + context: ./frontend networks: - inventory_net ports: diff --git a/export_prod.sh b/export_prod.sh index 40b77af3..0d7e9571 100755 --- a/export_prod.sh +++ b/export_prod.sh @@ -3,8 +3,8 @@ echo "📦 Preparing TFM aInventory Production Bundle..." -# Extract version from VERSION.json using grep to avoid macOS python/xcode stubs -VERSION=$(grep '"version"' VERSION.json | head -n 1 | awk -F '"' '{print $4}') +# Extract version from frontend/VERSION.json +VERSION=$(grep '"version"' frontend/VERSION.json | head -n 1 | awk -F '"' '{print $4}') PROD_DIR="aInventory-PROD-v${VERSION}" # Clean previous run if it exists @@ -30,8 +30,8 @@ cp inventory.service.template "$PROD_DIR/" cp USER_GUIDE.md "$PROD_DIR/" cp README.md "$PROD_DIR/INSTALLATION_GUIDE.md" cp .git_path "$PROD_DIR/" 2>/dev/null || true -cp VERSION.json "$PROD_DIR/" -cp VERSION.json "$PROD_DIR/frontend/" +cp frontend/VERSION.json "$PROD_DIR/" +cp frontend/VERSION.json "$PROD_DIR/frontend/" # Setup persistent volume skeleton mkdir -p "$PROD_DIR/data" diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 740efb4b..944116a2 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -4,16 +4,15 @@ FROM node:20-alpine AS base FROM base AS deps RUN apk add --no-cache libc6-compat WORKDIR /app -# Context is root to allow access to VERSION.json -COPY frontend/package.json frontend/package-lock.json* ./ +# We run this from the frontend folder context +COPY package.json package-lock.json* ./ RUN npm ci # Step 2: Build the source code FROM base AS builder WORKDIR /app COPY --from=deps /app/node_modules ./node_modules -COPY frontend . -COPY VERSION.json . +COPY . . # Disable telemetry during build ENV NEXT_TELEMETRY_DISABLED 1 RUN npm run build diff --git a/frontend/VERSION.json b/frontend/VERSION.json new file mode 100644 index 00000000..410eaf56 --- /dev/null +++ b/frontend/VERSION.json @@ -0,0 +1,5 @@ +{ + "version": "1.8.5", + "last_build": "2026-04-13-1951", + "codename": "ConfigSync" +} \ No newline at end of file diff --git a/frontend/app/page.tsx b/frontend/app/page.tsx index 3f56e18c..51f5ec35 100644 --- a/frontend/app/page.tsx +++ b/frontend/app/page.tsx @@ -48,7 +48,7 @@ import { generateBarcode128, getQRCodeURL } from '@/lib/labels'; import { clsx, type ClassValue } from 'clsx'; import { twMerge } from 'tailwind-merge'; import axios from 'axios'; -import versionData from '../../VERSION.json'; +import versionData from '../VERSION.json'; interface User { id: number; diff --git a/scripts/save_version.py b/scripts/save_version.py index 4c0aa656..1cb025ec 100644 --- a/scripts/save_version.py +++ b/scripts/save_version.py @@ -4,7 +4,7 @@ import os import sys from datetime import datetime -VERSION_FILE = 'VERSION.json' +VERSION_FILE = 'frontend/VERSION.json' GIT_PATH_FILE = '.git_path' def get_git_path():