forked from lobantseff/ml-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (27 loc) · 1.19 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
FROM nvcr.io/nvidia/pytorch:24.11-py3
ENV PYTHONUNBUFFERED=1
# -------------------------- Install essential Linux packages ---------------------------
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
unzip \
screen \
tmux \
net-tools \
iputils-ping \
&& rm -rf /var/lib/apt/lists/*
# ------------------- Configure Jupyter and Tensorboard individually --------------------
RUN echo "#!/bin/sh" > ~/init.sh
COPY .jupyter_password set_jupyter_password.py /root/.jupyter/
RUN pip install -U jupyterlab ipywidgets \
&& python /root/.jupyter/set_jupyter_password.py /root \
&& echo "/usr/local/bin/jupyter lab --allow-root --no-browser --notebook-dir=/code/notebooks &" >> ~/init.sh
RUN pip install -U tensorboard \
&& mkdir -p /ws/tensorboard_logs \
&& echo "/usr/local/bin/tensorboard --logdir=/ws/tensorboard_logs --bind_all" >> ~/init.sh \
&& echo "true" >> /root/.tensorboard_installed
RUN echo "sleep infinity" >> ~/init.sh
RUN chmod +x ~/init.sh
# ------------------------------------ Miscellaneous ------------------------------------
ENV TB_DIR=/ws/experiments
WORKDIR /code
CMD ["sh", "-c", "~/init.sh"]