Spaces:
Runtime error
Runtime error
| FROM nvidia/cuda:12.6.0-runtime-ubuntu22.04 | |
| ARG PORT=7860 | |
| ENV PORT=${PORT} | |
| ENV CONFIG_PATH=config_dev.yaml | |
| ENV SQLALCHEMY_DATABASE_URL=sqlite:////data/logs.db | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| WORKDIR /app | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| python3.11 \ | |
| python3.11-distutils \ | |
| wget \ | |
| && wget https://bootstrap.pypa.io/get-pip.py \ | |
| && python3.11 get-pip.py \ | |
| && rm get-pip.py \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set Python 3.11 as the default python3 | |
| RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 \ | |
| && update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 | |
| # Устанавливаем специфичные версии библиотек PyTorch | |
| RUN python -m pip install \ | |
| torch==2.6.0+cu126 \ | |
| --index-url https://download.pytorch.org/whl/cu126 | |
| COPY requirements.txt /app/ | |
| RUN python -m pip install -r requirements.txt | |
| COPY . . | |
| RUN python -m pip install -e ./lib/parser | |
| RUN python -m pip install --no-deps -e ./lib/extractor | |
| # RUN python -m pip install --ignore-installed elasticsearch==7.11.0 || true | |
| RUN mkdir -p /data/regulation_datasets /data/documents /logs | |
| EXPOSE ${PORT} | |
| CMD ["sh", "-c", "uvicorn main:app --host 0.0.0.0 --port ${PORT}"] | |