Configured frontend during image build

This commit is contained in:
Marcin-Ramotowski
2025-04-29 09:12:34 +00:00
parent 2d947cccc3
commit c70d0d0300
3 changed files with 6 additions and 2 deletions

View File

@ -4,7 +4,7 @@ WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
RUN VITE_API_URL="http://localhost:5000" npm run build
# Etap 2: Nginx
FROM nginx:alpine

View File

@ -1,7 +1,7 @@
import axios from "axios";
import Cookies from "js-cookie";
const API_URL = "http://localhost:5000";
const API_URL = import.meta.env.VITE_API_URL;
const api = axios.create({
baseURL: API_URL,