From a38fd042ba4a038726db79807414c38fe23078d8 Mon Sep 17 00:00:00 2001 From: julius Date: Thu, 18 Dec 2025 19:28:39 +0100 Subject: [PATCH] build frontend in node docker container --- frontend/.env | 1 + frontend/Dockerfile.frontend | 10 ++++++++++ frontend/src/api.ts | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 frontend/.env create mode 100644 frontend/Dockerfile.frontend diff --git a/frontend/.env b/frontend/.env new file mode 100644 index 0000000..585477b --- /dev/null +++ b/frontend/.env @@ -0,0 +1 @@ +VITE_BASE_URL= diff --git a/frontend/Dockerfile.frontend b/frontend/Dockerfile.frontend new file mode 100644 index 0000000..3a9c45b --- /dev/null +++ b/frontend/Dockerfile.frontend @@ -0,0 +1,10 @@ +FROM node:alpine + +WORKDIR /app +COPY package.json ./ + +RUN npm install + +COPY . . + +RUN npm run build diff --git a/frontend/src/api.ts b/frontend/src/api.ts index 07c2bca..034e46b 100644 --- a/frontend/src/api.ts +++ b/frontend/src/api.ts @@ -1,6 +1,6 @@ import { useSession } from "./Session"; -export const baseUrl = import.meta.env.VITE_BASE_URL as string; +export const baseUrl = ""; export async function apiAuth( path: string, @@ -95,6 +95,7 @@ export type LoginRequest = { }; export const login = async (req: LoginRequest): Promise => { + console.log("baseUrl", baseUrl); try { const response = await fetch(`${baseUrl}api/token`, { method: "POST",