-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.devenv
34 lines (26 loc) · 1.27 KB
/
Dockerfile.devenv
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
# get our base pytorch container image from torch official docker hub repository
FROM pytorch/pytorch:1.13.1-cuda11.6-cudnn8-runtime
# Install SSH server
RUN apt-get update && apt-get install -y openssh-server libgl1
# Set the root password (you should use a more secure method in production)
RUN mkdir /var/run/sshd
RUN echo 'root:root' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# Create dev user with password 'dev'
RUN useradd -ms /bin/bash dev && echo 'dev:dev' | chpasswd
# Define work directory.
ARG PROJECT_PATH="/home/dev/3D-Volumetric-MedicalImageSegmentationWithDeepLearning/"
WORKDIR $PROJECT_PATH
### Install additional libraries
COPY requirements.txt $PROJECT_PATH
RUN pip install -r requirements.txt
# Add src folder as package
ENV PYTHONPATH "${PYTHONPATH}:$PROJECT_PATH/src"
# Set jupyter notebook password
ARG TOKEN
RUN jupyter notebook --generate-config
RUN echo "c.NotebookApp.password_required = True" >> /root/.jupyter/jupyter_notebook_config.py
RUN echo "c.NotebookApp.token = '$TOKEN'" >> /root/.jupyter/jupyter_notebook_config.py
RUN echo "c.NotebookApp.password = '$TOKEN'" >> /root/.jupyter/jupyter_notebook_config.py
# Install nbextension js and css files
RUN jupyter contrib nbextension install --sys-prefix