File size: 927 Bytes
b67158e 75d9b3c e5e09a3 75d9b3c e5e09a3 75d9b3c e5e09a3 75d9b3c | 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 27 28 29 30 31 32 33 34 35 36 37 38 | FROM python:3.12
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Upgrade pip and add build tools just in case
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
# Install python requirements
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Create necessary directories
RUN mkdir -p /app/data /app/frontend
# Copy the rest of the application
COPY backend/ /app/backend/
COPY frontend/ /app/frontend/
COPY config.py /app/config.py
# Create a non-root user for Hugging Face space compatibility
RUN useradd -m -u 1000 user
RUN chown -R user:user /app
USER user
# Expose the standard port for Hugging Face spaces
EXPOSE 7860
# Run the application
CMD ["uvicorn", "backend.server:app", "--host", "0.0.0.0", "--port", "7860"]
|