Create Dockerfile
Browse files- Dockerfile +41 -0
Dockerfile
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# syntax=docker/dockerfile:1.4
|
2 |
+
FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu18.04
|
3 |
+
# BEGIN Static part
|
4 |
+
ENV DEBIAN_FRONTEND=noninteractive \
|
5 |
+
TZ=Europe/Paris
|
6 |
+
|
7 |
+
RUN apt-get update && apt-get install -y \
|
8 |
+
git \
|
9 |
+
make build-essential libssl-dev zlib1g-dev \
|
10 |
+
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
|
11 |
+
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev git-lfs \
|
12 |
+
ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx \
|
13 |
+
&& rm -rf /var/lib/apt/lists/* \
|
14 |
+
&& git lfs install
|
15 |
+
|
16 |
+
# User
|
17 |
+
RUN useradd -m -u 1000 user
|
18 |
+
USER user
|
19 |
+
ENV HOME=/home/user \
|
20 |
+
PATH=/home/user/.local/bin:$PATH
|
21 |
+
WORKDIR /home/user/app
|
22 |
+
|
23 |
+
# Pyenv
|
24 |
+
RUN curl https://pyenv.run | bash
|
25 |
+
ENV PATH=$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH
|
26 |
+
|
27 |
+
# Python
|
28 |
+
RUN pyenv install 3.7.5 && \
|
29 |
+
pyenv global 3.7.5 && \
|
30 |
+
pyenv rehash && \
|
31 |
+
pip install --no-cache-dir --upgrade pip setuptools wheel && \
|
32 |
+
pip install --no-cache-dir \
|
33 |
+
datasets \
|
34 |
+
huggingface-hub "protobuf<4" "click<8.1"
|
35 |
+
|
36 |
+
COPY --link --chown=1000 requirements.txt /home/user/app/requirements.txt
|
37 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
38 |
+
|
39 |
+
COPY --link --chown=1000 ./ /home/user/app
|
40 |
+
|
41 |
+
CMD ["python", "-m", "detector.server", "detector-base.pt", "--port=7860"]
|