-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
60 lines (49 loc) · 1.56 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM nvidia/cuda:12.1.1-base-ubuntu22.04 AS base
ARG DEV_dentexmodel
ENV \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
PIP_SRC=/src \
PIPENV_HIDE_EMOJIS=true \
NO_COLOR=true \
PIPENV_NOSPIN=true
# Port for JupyterLab server
EXPOSE 8888
RUN mkdir -p /app
WORKDIR /app
# System dependencies
RUN apt-get update -y && \
apt-get install -y \
'python3.10' \
'python3-pip' \
'git' \
'libgl1-mesa-glx' \
'ffmpeg' \
'libsm6' \
'libxext6' \
'ninja-build'
# Create a symbolic link for python
RUN ln -s /usr/bin/python3 /usr/bin/python
# Pip and pipenv
RUN pip install --upgrade pip
RUN pip install pipenv
# Some package stuff
COPY setup.py ./
COPY src/dentexmodel/__init__.py src/dentexmodel/__init__.py
# Install dependencies into system python
COPY Pipfile Pipfile.lock ./
# RUN pipenv install --system --deploy --ignore-pipfile --dev
# This allows the version to be inferred properly form inside the container
# without copying the entire .git folder
RUN --mount=source=.git,target=.git,type=bind \
pipenv install --system --deploy --ignore-pipfile --dev
# Install dependencies from setup.cfg (ignored py pipenv system installs)
RUN python -m pip install setuptools setuptools-scm torch torchvision torchaudio
RUN python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
# Run the jupyter lab server
CMD ["/bin/bash", "/app/bash_scripts/docker_entry.sh"]