Spaces:
Running
Running
FROM python:3.11-slim | |
WORKDIR /app | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y \ | |
build-essential \ | |
curl \ | |
libcurl4-openssl-dev \ | |
libssl-dev \ | |
# Chrome dependencies | |
wget \ | |
gnupg \ | |
fonts-liberation \ | |
libasound2 \ | |
libatk-bridge2.0-0 \ | |
libatk1.0-0 \ | |
libatspi2.0-0 \ | |
libcups2 \ | |
libdbus-1-3 \ | |
libdrm2 \ | |
libgbm1 \ | |
libgtk-3-0 \ | |
libnspr4 \ | |
libnss3 \ | |
libxcomposite1 \ | |
libxdamage1 \ | |
libxfixes3 \ | |
libxkbcommon0 \ | |
libxrandr2 \ | |
xdg-utils \ | |
# Install Chrome | |
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ | |
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \ | |
&& apt-get update \ | |
&& apt-get install -y google-chrome-stable \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Copy requirements first to leverage Docker cache | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy the rest of the application | |
COPY . . | |
# Expose the port the app runs on | |
EXPOSE 7860 | |
# Environment variables with defaults | |
ENV OPENAI_API_KEY=None | |
ENV ENVIRONMENT="production" | |
ENV PORT=7860 | |
# Command to run the application | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |