Spaces:
Runtime error
Runtime error
File size: 788 Bytes
65ca4cf f9b9553 65ca4cf | 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 | # Use lightweight Python base
FROM python:3.10-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Set working directory
WORKDIR /code
# Install dependencies
COPY requirements.txt .
RUN apt-get update && apt-get install -y \
build-essential \
libpoppler-cpp-dev \
pkg-config \
python3-dev \
curl \
git \
libgl1 \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Copy app files
COPY app /code/app
COPY models /code/models
COPY .env /code/.env
COPY app/main.py /code/app/main.py
COPY app/backend.py /code/app/backend.py
# Expose port for FastAPI
EXPOSE 7860
# Run FastAPI server
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|