aboutsummaryrefslogtreecommitdiffstats
path: root/standalone/src/main/assembly/dockerfile
blob: c6636f33faa848f161e11887a8bbfee63719ee3a (plain)
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
# hadolint ignore=DL3007
FROM tensorflow/serving:2.10.0

WORKDIR /home/uuihome/uui

COPY requirements.txt /home/uuihome/uui/requirements.txt

RUN apt-get update && apt-get install -y ruby zlib1g zlib1g.dev libjpeg-dev

# hadolint ignore=DL3008
RUN groupadd uui -g 1000 && \
    useradd -u 1000 -d /home/uuihome/uui -g uui -s /bin/bash uui && \
    DEBIAN_FRONTEND=noninteractive apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
      build-essential \
      curl \
      python3-dev \
      python3-pip \
      unzip && \
    curl -LO https://github.com/google-research/bert/archive/master.zip && \
    curl -LO https://storage.googleapis.com/bert_models/2018_10_18/uncased_L-12_H-768_A-12.zip && \
    unzip master.zip && \
    unzip uncased_L-12_H-768_A-12.zip && \
    rm master.zip uncased_L-12_H-768_A-12.zip && \
    ln -sf /usr/bin/python3 /usr/bin/python && \
    ln -sf /usr/bin/pip3 /usr/bin/pip && \
    pip install --upgrade setuptools && \
    pip install --upgrade pip && \
    pip install wheel && \
    pip install torch==1.10.1 torchvision==0.11.2+cpu torchaudio==0.10.1 --extra-index-url https://download.pytorch.org/whl/cpu && \
    pip install --no-cache-dir -r requirements.txt && \
    DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y \
      build-essential \
      curl \
      python3-dev \
      unzip && \
    DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

COPY scripts /home/uuihome/uui/bert-master/
COPY run.sh /home/uuihome/uui/run.sh

RUN chown -R uui:uui /home/uuihome/uui
USER uui

ENTRYPOINT ["/home/uuihome/uui/run.sh"]