fix: VERSION file resolution in Docker build context
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
Desktop App / Build Linux (amd64) (push) Has been cancelled
Desktop App / Attach to Release (push) Has been cancelled

- Dockerfile now copies VERSION into /build/web/VERSION for vite
- vite.config.ts tries ../VERSION (local dev) then ./VERSION (Docker)
This commit is contained in:
2026-07-14 11:13:58 +02:00
parent 7847cdffd6
commit 5b403141ea
2 changed files with 11 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ FROM node:22-alpine AS builder
WORKDIR /build/web
COPY web/package.json web/package-lock.json ./
RUN npm ci
COPY VERSION ./
COPY web/ ./
RUN npm run build

View File

@@ -1,9 +1,17 @@
import { svelte } from '@sveltejs/vite-plugin-svelte'
import tailwindcss from '@tailwindcss/vite'
import { defineConfig } from 'vite'
import { readFileSync } from 'fs'
import { readFileSync, existsSync } from 'fs'
const version = readFileSync('../VERSION', 'utf-8').trim()
// In Docker, VERSION is copied into the build WORKDIR (/build/web/VERSION).
// In local dev, the cwd is web/ and VERSION is two dirs up (../../VERSION
// from vite.config.ts location in web/). Try both.
let version: string
if (existsSync('../VERSION')) {
version = readFileSync('../VERSION', 'utf-8').trim()
} else {
version = readFileSync('VERSION', 'utf-8').trim()
}
// Injects OIKOS_API_TOKEN into proxied /api requests in dev — the API no
// longer has a dev-open bypass (plans/2026-07-12-wails-desktop-app.md 0.4),