-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (24 loc) · 1.16 KB
/
Dockerfile
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 nvidia/cuda:11.3.1-cudnn8-runtime-ubuntu20.04 AS build
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends apt-utils build-essential pkg-config libssl-dev libffi-dev libxcb-xinerama0 git \
python3.8 python3-dev python3.8-venv python3-pip && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
COPY requirements.txt .
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
FROM nvidia/cuda:11.3.1-base-ubuntu20.04
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /tarmass
COPY --from=build /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
ENV PYTHONPATH="/tarmass/src"
ENV QTWEBENGINE_DISABLE_SANDBOX=1
RUN apt-get update && \
apt-get install -y --no-install-recommends apt-utils python3-opencv unzip python3 \
libxkbcommon-x11-0 libxcb-xinerama0 libxtst6 libasound2 && \
python3 -c "import easyocr ; easyocr.Reader(['en'])" && \
python -c "from torch.utils.model_zoo import load_url; load_url('https://download.pytorch.org/models/resnet50-11ad3fa6.pth')" && \
apt-get clean && rm -rf /var/lib/apt/lists/*