Spaces:
Sleeping
Sleeping
| # Use an official Python runtime as a parent image | |
| FROM python:3.10-slim | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Install system dependencies from packages.txt | |
| COPY packages.txt . | |
| RUN apt-get update && apt-get install -y $(cat packages.txt) | |
| # Copy the requirements file and install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of the application code | |
| COPY . . | |
| # Expose the port the app runs on | |
| EXPOSE 7860 | |
| # Use printf to safely write the multi-line JSON secret to a file, then start the app. | |
| CMD /bin/bash -c 'printf "%s" "$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' | |
| # Command to run the application (orinally created by Jules) | |
| # CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"] | |