Merge pull request 'feat: Configure VITE_API_URL during build via Gitea workflow and Dockerfile, removing local fallback.' (#3) from master into dev
Build & Push Hospitality / build-and-push (push) Successful in 3m40s

Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
2025-11-25 18:27:38 +00:00
3 changed files with 11 additions and 1 deletions
+7
View File
@@ -45,7 +45,14 @@ jobs:
# ---------- Frontend ----------
- name: Build Frontend (${{ env.TAG }})
run: |
if [ "$TAG" = "dev" ]; then
API_URL="http://t610:5005/api"
else
API_URL="http://t610:5004/api"
fi
docker build \
--build-arg VITE_API_URL=$API_URL \
-t $REGISTRY/hospitality-frontend:${TAG} \
-f src/hospitality-web/Dockerfile \
src/hospitality-web
+3
View File
@@ -9,6 +9,9 @@ RUN npm ci
# Kopier resten av koden
COPY . .
ARG VITE_API_URL
ENV VITE_API_URL=$VITE_API_URL
# Bygg for produksjon
RUN npm run build
+1 -1
View File
@@ -1,7 +1,7 @@
import axios from 'axios';
import type { LoginRequest, LoginResponse, UserInfo } from '../types/auth';
const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:5163/api';
const API_BASE_URL = import.meta.env.VITE_API_URL;
export const api = axios.create({
baseURL: API_BASE_URL,