diff --git a/.forgejo/workflows/start.yaml b/.forgejo/workflows/start.yaml index 3db1405..61f8c6f 100644 --- a/.forgejo/workflows/start.yaml +++ b/.forgejo/workflows/start.yaml @@ -77,6 +77,9 @@ jobs: - name: Write secrets in an .env file run: | echo ${{ secrets.API_PORT }} >> .env + echo ${{ secrets.FRONTEND_PORT }} >> .env + echo ${{ secrets.AI_API_KEY }} >> .env + - name: Setup remote connection and deploy container. env: diff --git a/api/src/main.py b/api/src/main.py index 77b0050..f6db2aa 100644 --- a/api/src/main.py +++ b/api/src/main.py @@ -5,7 +5,7 @@ import os # Load environment variables (from run.sh) load_dotenv() -GEMINI_KEY = os.getenv("GEMINI_KEY") +GEMINI_KEY = os.getenv("AI_API_KEY") # gemini stuff client = genai.Client(api_key=GEMINI_KEY) diff --git a/docker-compose.yml b/docker-compose.yml index 7dfab34..dddb628 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,10 +3,12 @@ services: command: "web" image: git.devdoes.work/devaine/fbla-cs-competition:app ports: - - 3000:3000 + - ${FRONTEND_PORT}:3000 api: command: "api" image: git.devdoes.work/devaine/fbla-cs-competition:app + environment: + AI_API_KEY: ${AI_API_KEY} ports: - - 8000:8000 + - ${API_PORT}:8000 diff --git a/start.bash b/start.bash index ca172ad..31a85f9 100755 --- a/start.bash +++ b/start.bash @@ -4,5 +4,6 @@ echo "$@" if [[ $1 == "web" ]]; then cd ./frontend/ && npm run start elif [[ $1 == "api" ]]; then + export | grep "AI_API_KEY" >>./api/.env cd ./api/src && source ../venv/bin/activate && fastapi run fi