File size: 1,064 Bytes
587bde8
 
9d5afc1
 
587bde8
 
 
 
161c044
 
 
 
587bde8
 
 
 
 
 
 
af09227
587bde8
43f017a
 
1d2d5fc
 
6785f1c
 
587bde8
 
 
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
FROM python:3.11.9

RUN apt update && apt install -y default-jdk

RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PIPENV_VENV_IN_PROJECT=1

WORKDIR $HOME/app

RUN --mount=type=secret,id=GITLAB_CREDENTIALS,mode=0444,required=true \
    git clone "https://$(cat /run/secrets/GITLAB_CREDENTIALS)@gitlab.com/bookingcare/search.git" -b dev .
RUN python -m pip install --upgrade pip
RUN pip install --user pipenv
RUN echo 'export PATH="/home/user/.local/bin:$PATH"' >> $HOME/.bashrc
RUN . $HOME/.bashrc
RUN pipenv install
RUN . $HOME/app/.venv/bin/activate
RUN which python && python --version
RUN python cli/downloader/vncorenlp_download.py
RUN python cli/downloader/stanza_download.py
RUN python cli/downloader/sentence_transformer_model_download.py -m bookingcare/multilingual-e5-base-v2
RUN python cli/downloader/sentence_transformer_model_download.py -m bookingcare/multilingual-e5-base-similarity-v1-onnx-quantized

EXPOSE 7860
CMD ["sh", "bin/hf-api-start.sh"]