Spaces:
Runtime error
Runtime error
| FROM python:3.10 | |
| WORKDIR /code | |
| # Install libgl1-mesa-glx | |
| RUN apt-get update && apt-get install -y libgl1-mesa-glx tesseract-ocr libtesseract-dev | |
| COPY ./requirements.txt /code/requirements.txt | |
| COPY ./app /code/app | |
| # Create and activate a virtual environment | |
| RUN python -m venv /venv | |
| # Install dependencies into the virtual environment | |
| RUN /venv/bin/pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| # Set the environment variable to use the virtual environment's Python interpreter | |
| ENV PATH="/venv/bin:$PATH" | |
| WORKDIR $HOME/app | |
| COPY --chown=user . $HOME/app | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] |