File size: 1,053 Bytes
8afe88e
2656673
 
 
e10831d
2656673
 
8afe88e
2656673
 
9ffc414
 
e10831d
2656673
 
9ffc414
8afe88e
 
e10831d
8afe88e
 
 
 
 
e10831d
9ffc414
 
 
 
 
e10831d
9ffc414
8afe88e
2656673
 
 
8afe88e
2656673
8afe88e
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
FROM python:3.11-slim

WORKDIR /app

# системные зависимости
RUN apt-get update && apt-get install -y \
    build-essential \
    python3-dev \
    curl \
    git \
    swig \
    wget \
    unzip \
    && rm -rf /var/lib/apt/lists/*

# апгрейд pip/setuptools/wheel
RUN python -m pip install --upgrade pip setuptools wheel

# заранее установить numpy и cython
RUN python -m pip install numpy cython

COPY requirements.txt .
RUN python -m pip install --no-cache-dir -r requirements.txt

# загрузим предобученные GloVe-вектора и распакуем
RUN mkdir -p /app/models && \
    cd /app/models && \
    if [ ! -f glove.6B.zip ]; then \
      wget -q https://nlp.stanford.edu/data/glove.6B.zip -O glove.6B.zip; \
    fi && \
    unzip -o glove.6B.zip && rm -f glove.6B.zip

COPY . .

EXPOSE 8501

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1

ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]