-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
42 lines (35 loc) · 1.3 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
# Build from a recent python3 version (64 bit python required for Tensorflow)
FROM nvidia/cuda:11.4.2-cudnn8-devel-ubuntu20.04
RUN export DEBIAN_FRONTEND=noninteractive; \
apt-get update && \
apt-get install -y \
# Code is in python
python3 python3-pip python3-dev python3-venv\
# OpenCV dependencies
libsm6 libxext6 libxrender-dev \
# GIST dependencies
build-essential libfftw3-3 libfftw3-bin libfftw3-dev libjpeg-dev zlib1g-dev libglib2.0-0
# Create directories
RUN mkdir -p /usr/src/app/code
WORKDIR /usr/src/app/code/
# Install required python modules first, to use pip caching
ADD code/requirements.txt /usr/src/app/code
RUN pip3 install --upgrade pip
RUN pip3 install -r requirements.txt
RUN pip3 install \
torch==1.12.0+cu113 \
torchvision==0.13.0+cu113 \
-f https://download.pytorch.org/whl/torch_stable.html
# Setup GIST dependencies
COPY dependencies/ /usr/src/app/dependencies
WORKDIR /usr/src/app/dependencies/pyleargist-2.0.5/
RUN ls -la .
RUN python3 setup.py build
RUN python3 setup.py install
# Set NVIDIA environment variables
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
# Set code folder to PYTHONPATH
ENV PYTHONPATH "${PYTHONPATH}:/usr/src/app/code"
# Set workdir back to code
WORKDIR /usr/src/app/code