Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for undefined environment variables #1723

Merged
merged 4 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
version: "3.7"

services:
frontend:
build: frontend
ports:
- "3001:3001"
environment:
- REACT_APP_AI_CONNECTION_STRING=
- REACT_APP_BACKEND_URL=http://localhost:8000
- REACT_APP_BACKEND_API_SCOPE=api://ea4c7b92-47b3-45fb-bd25-a8070f0c495c/user_impersonation
- REACT_APP_FRONTEND_URL=http://localhost:3001
- REACT_APP_FRONTEND_BASE_ROUTE=
- REACT_APP_AD_CLIENT_ID=f5993820-b7e2-4791-886f-f9f5027dc7be
- REACT_APP_AD_TENANT_ID=3aa4a235-b6e2-48d5-9195-7fcf05b459b0
env_file: "frontend/.env"
broker:
build:
context: broker
Expand Down
2 changes: 1 addition & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:alpine as build
FROM node:alpine AS build

WORKDIR /app

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const getEnvVariable = (name: string): string => {
// If global value equals its placeholder value 'placeholderValue', it is considered undefined
const placeholderValue: string = '${' + name + '}'

if (globalValue === placeholderValue || !globalValue)
if (globalValue === placeholderValue || globalValue === undefined)
throw new Error(
`Global variable "${name}" is not set. Verify that your .env file is up to date with .env.example`
)
Expand Down
Loading