File size: 1,355 Bytes
57cf043
 
 
 
9390ea2
7f33210
57cf043
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86c402d
57cf043
 
 
 
86c402d
 
 
d1e4582
86c402d
57cf043
 
 
 
 
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
39
40
41
42
43
44
45
46
47
48
FROM nvidia/cuda:12.6.0-runtime-ubuntu22.04

ARG PORT=7860
ENV PORT=${PORT}
ENV CONFIG_PATH=config_hf.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}"]