File tree Expand file tree Collapse file tree 4 files changed +14
-10
lines changed Expand file tree Collapse file tree 4 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 11** /node_modules
2+ .env
Original file line number Diff line number Diff line change @@ -14,8 +14,6 @@ WORKDIR /app
1414# Copy ingester files
1515COPY ingesters ./ingesters
1616
17- # Copy .env file for configuration
18- COPY .env ./.env
1917
2018# Copy ingester files generated from python
2119COPY python/src/scripts/summarizer/generated ./python/src/scripts/summarizer/generated
Original file line number Diff line number Diff line change 11import { type VectorStoreConfig } from '../types' ;
22import dotenv from 'dotenv' ;
33import { getRepoPath } from '../utils/paths' ;
4+ import { existsSync } from 'fs' ;
45
5- dotenv . config ( { path : getRepoPath ( '.env' ) } ) ;
6+ // Load .env from repo root if present; otherwise rely on runtime env vars.
7+ const envPath = getRepoPath ( '.env' ) ;
8+ if ( existsSync ( envPath ) ) {
9+ dotenv . config ( { path : envPath } ) ;
10+ } else {
11+ dotenv . config ( ) ;
12+ }
613
714// API Keys from environment variables only
815export const getOpenaiApiKey = ( ) => process . env . OPENAI_API_KEY ;
Original file line number Diff line number Diff line change @@ -2,18 +2,16 @@ import path from 'path';
22import { existsSync } from 'fs' ;
33
44/**
5- * Find the repository root by looking for .git directory
5+ * Find the repository root by looking for package.json and going up the directory tree
66 */
77function findRepoRoot ( ) : string {
88 let currentDir = import . meta. dir ; // Bun's way to get current directory
99
10- // Walk up the directory tree looking for .env
10+ // Walk up the directory tree looking for package.json
1111 while ( currentDir !== '/' ) {
12- if (
13- existsSync ( path . join ( currentDir , '.env' ) ) ||
14- existsSync ( path . join ( currentDir , '.git' ) )
15- ) {
16- return currentDir ;
12+ if ( existsSync ( path . join ( currentDir , 'package.json' ) ) ) {
13+ // Go one level up from the package.json location
14+ return path . dirname ( currentDir ) ;
1715 }
1816 currentDir = path . dirname ( currentDir ) ;
1917 }
You can’t perform that action at this time.
0 commit comments