Spaces:
Sleeping
Sleeping
File size: 722 Bytes
9fe25e8 1d7821d 9fe25e8 1d7821d 9fe25e8 1d7821d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | FROM python:3.11-slim
WORKDIR /code
# Install system libraries needed for database drivers
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install dependencies
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt --only-binary :all:
# Copy all files into a backend/ subfolder inside the container to match python import paths
COPY . /code/backend
# Set the Python path to include the root /code directory
ENV PYTHONPATH=/code
# Hugging Face Spaces routes internal traffic to port 7860
CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "7860"] |