Spaces:
Sleeping
Sleeping
Mike W commited on
Commit ·
2f10ec0
1
Parent(s): 1323577
Fix GOOGLE_APPLICATION_CREDENTIALS in Dockerfile
Browse files- Dockerfile +6 -3
Dockerfile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# Use an official Python runtime as a parent image
|
| 2 |
-
FROM python:3.
|
| 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 |
-
#
|
| 22 |
-
CMD
|
|
|
|
|
|
|
|
|
|
|
|
| 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"]
|