-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
65 lines (49 loc) · 2.24 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
61
62
63
64
65
FROM noelmni/cuda:10.0-cudnn7-devel-ubuntu18.04
LABEL maintainer="Ravnoor Singh Gill <ravnoor@gmail.com>" \
org.opencontainers.image.title="deepFCD" \
org.opencontainers.image.description="Automated Detection of Focal Cortical Dysplasia using Deep Learning" \
org.opencontainers.image.licenses="BSD-3-Clause" \
org.opencontainers.image.source="https://github.com/NOEL-MNI/deepFCD" \
org.opencontainers.image.url="https://github.com/NOEL-MNI/deepFCD"
# manually update outdated repository key
# fixes invalid GPG error: https://forums.developer.nvidia.com/t/gpg-error-http-developer-download-nvidia-com-compute-cuda-repos-ubuntu1804-x86-64/212904
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y git \
bash \
wget \
bzip2 \
sudo \
&& sudo apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV PATH=/home/user/conda/bin:${PATH}
# create a working directory
RUN mkdir /app
WORKDIR /app
# create a non-root user and switch to it
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
&& chown -R user:user /app
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
USER user
# all users can use /home/user as their home directory
ENV HOME=/home/user
RUN chmod 777 /home/user
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py38_23.5.2-0-Linux-x86_64.sh \
&& /bin/bash Miniconda3-py38_23.5.2-0-Linux-x86_64.sh -b -p /home/user/conda \
&& rm Miniconda3-py38_23.5.2-0-Linux-x86_64.sh
# RUN conda update -n base -c defaults conda
RUN git clone --depth 1 https://github.com/NOEL-MNI/deepMask.git \
&& rm -rf deepMask/.git
RUN eval "$(conda shell.bash hook)" \
&& conda create -n preprocess python=3.8 \
&& conda activate preprocess \
&& python -m pip install -r deepMask/app/requirements.txt \
&& conda deactivate
COPY app/requirements.txt /app/requirements.txt
RUN python -m pip install -r /app/requirements.txt \
&& conda install -c conda-forge pygpu==0.7.6 \
&& pip cache purge
COPY app/ /app/
COPY tests/ /tests/
RUN sudo chmod -R 777 /app && sudo chmod +x /app/inference.py
CMD ["python3"]