Mike W commited on
Commit
2f10ec0
·
1 Parent(s): 1323577

Fix GOOGLE_APPLICATION_CREDENTIALS in Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -3
Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
  # Use an official Python runtime as a parent image
2
- FROM python:3.9-slim
3
 
4
  # Set the working directory in the container
5
  WORKDIR /app
@@ -18,5 +18,8 @@ COPY . .
18
  # Expose the port the app runs on
19
  EXPOSE 8000
20
 
21
- # Command to run the application
22
- CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "8000"]
 
 
 
 
1
  # Use an official Python runtime as a parent image
2
+ FROM python:3.10-slim
3
 
4
  # Set the working directory in the container
5
  WORKDIR /app
 
18
  # Expose the port the app runs on
19
  EXPOSE 8000
20
 
21
+ # This new CMD line creates the creds file from the secret before starting the app
22
+ CMD /bin/bash -c "echo \"$GOOGLE_APPLICATION_CREDENTIALS\" > /tmp/gcp_creds.json && export GOOGLE_APPLICATION_CREDENTIALS=/tmp/gcp_creds.json && uvicorn server:app --host 0.0.0.0 --port 7860"
23
+
24
+ # Command to run the application (orinally created by Jules)
25
+ # CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "8000"]