diff --git a/Dockerfile b/Dockerfile index ff1a89a..3414b86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,8 @@ FROM node:16-alpine as client-builder COPY ./client /client WORKDIR /client RUN npm install + +RUN echo "VITE_APIURL=/api/v1" > .env.production RUN npm run build FROM python:3.11-alpine as runner diff --git a/client/src/App.tsx b/client/src/App.tsx index 030af1e..9d3e6fc 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -43,12 +43,24 @@ function App() { getLocale: () => i18n.language, }; + if (!import.meta.env.VITE_APIURL) { + return ( + <> +
+ App was built without an API URL. Please set the VITE_APIURL + environment variable to the URL of your Spoolman API. +
+ > + ); + } + return (