File size: 914 Bytes
d6fcf92
2f10ec0
d6fcf92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1a93a30
d6fcf92
f46c356
 
2f10ec0
 
1a93a30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 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"]