File tree 3 files changed +81
-0
lines changed
3 files changed +81
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Docker Build
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - " main"
7
+
8
+ env :
9
+ REGISTRY : ghcr.io
10
+ IMAGE_NAME : ${{ github.repository }}
11
+
12
+ jobs :
13
+ docker :
14
+ runs-on : ubuntu-latest
15
+ permissions :
16
+ contents : read
17
+ packages : write
18
+ attestations : write
19
+ id-token : write
20
+ steps :
21
+ - name : Checkout repository
22
+ uses : actions/checkout@v4
23
+ - name : Log in to the Container registry
24
+ uses : docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
25
+ with :
26
+ registry : ${{ env.REGISTRY }}
27
+ username : ${{ github.actor }}
28
+ password : ${{ secrets.GITHUB_TOKEN }}
29
+
30
+ - name : Extract metadata (tags, labels) for Docker
31
+ id : meta
32
+ uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
33
+ with :
34
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35
+
36
+ - name : Build and push Docker image
37
+ id : push
38
+ uses : docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
39
+ with :
40
+ context : .
41
+ push : true
42
+ tags : ${{ steps.meta.outputs.tags }}
43
+ labels : ${{ steps.meta.outputs.labels }}
44
+
45
+ - name : Generate artifact attestation
46
+ uses : actions/attest-build-provenance@v1
47
+ with :
48
+ subject-name : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
49
+ subject-digest : ${{ steps.push.outputs.digest }}
50
+ push-to-registry : true
Original file line number Diff line number Diff line change
1
+ FROM python:3.11.4
2
+
3
+ ARG GOOGLE_CREDS_JSON
4
+ ARG WATSON_API_KEY
5
+ ARG WATSON_REGION
6
+ ARG WATSON_INSTANCE_ID
7
+ ARG MICROSOFT_TOKEN
8
+ ARG MICROSOFT_REGION
9
+ ARG GOOGLE_CREDS_PATH
10
+ ARG POLLY_REGION
11
+ ARG POLLY_AWS_KEY_ID
12
+ ARG POLLY_AWS_ACCESS_KEY
13
+ ARG ELEVENLABLS_API_KEY
14
+ ARG WITAI_TOKEN
15
+
16
+ WORKDIR /app
17
+ COPY . .
18
+
19
+ RUN apt-get update && \
20
+ apt-get install -y portaudio19-dev
21
+ RUN pip install -r requirements.txt
22
+
23
+ CMD uvicorn main:app --host 0.0.0.0 --port 8080
Original file line number Diff line number Diff line change @@ -53,6 +53,14 @@ def get_client(engine: str):
53
53
return PollyClient (credentials = (region , aws_key_id , aws_access_key ))
54
54
elif engine == 'google' :
55
55
creds_path = os .getenv ('GOOGLE_CREDS_PATH' )
56
+
57
+ google_creds_json = os .getenv ("GOOGLE_CREDS_JSON" )
58
+ if not google_creds_json :
59
+ raise ValueError ("GOOGLE_CREDS_JSON environment variable is not set" )
60
+
61
+ with open (creds_path , "w" ) as f :
62
+ f .write (google_creds_json )
63
+
56
64
logger .info (f"Google credentials path: { creds_path } " )
57
65
return GoogleClient (credentials = (creds_path ))
58
66
elif engine == 'microsoft' :
You can’t perform that action at this time.
0 commit comments