Skip to content

Commit

Permalink
Get google creds and runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinhenderson committed Jun 25, 2024
1 parent 710940f commit bf391d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ COPY . .
RUN apt-get update && \
apt-get install -y portaudio19-dev
RUN pip install -r requirements.txt
RUN python create_google_creds.py

CMD uvicorn main:app --host 0.0.0.0 --port 8080
8 changes: 8 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ def get_client(engine: str):
return PollyClient(credentials=(region, aws_key_id, aws_access_key))
elif engine == 'google':
creds_path = os.getenv('GOOGLE_CREDS_PATH')

google_creds_json = os.getenv("GOOGLE_CREDS_JSON")
if not google_creds_json:
raise ValueError("GOOGLE_CREDS_JSON environment variable is not set")

with open(creds_path, "w") as f:
f.write(google_creds_json)

logger.info(f"Google credentials path: {creds_path}")
return GoogleClient(credentials=(creds_path))
elif engine == 'microsoft':
Expand Down

0 comments on commit bf391d5

Please sign in to comment.