# FROM nvcr.io/nvidia/clara-train-sdk:v4.1
# FROM nvcr.io/nvidia/pytorch:22.08-py3
# FROM nvcr.io/nvidia/pytorch:24.01-py3
FROM nvcr.io/nvidia/tensorflow:24.03-tf2-py3

# apt
RUN apt-get update -y \
&&  apt-get install libxrender1 openssh-server pigz sudo  -y

# pip

# RUN pip install antspyx itk-elastix nipype nnunet nnunetv2 simpleitk==2.3.1 tensorflow[and-cuda] #too large .... install first

RUN pip install "torch<2.6" torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
RUN pip install antspyx itk-elastix nipype nnunet nnunetv2 simpleitk==2.3.1 #too large .... install first

# WORKDIR /workspace
WORKDIR /123
COPY requirements.txt /123
RUN pip install -r requirements.txt

RUN wget https://github.com/rordenlab/dcm2niix/releases/download/v1.0.20240202/dcm2niix_lnx.zip
RUN unzip dcm2niix_lnx.zip
RUN cp dcm2niix /usr/bin

# nnUNet

ENV nnUNet_raw_data_base="/workspace/nnUNet_raw_data_base"
ENV nnUNet_preprocessed="/workspace/nnUNet_preprocessed"
ENV RESULTS_FOLDER="/workspace/nnUNet_trained_models"

ENV nnUNet_raw="/workspace/v2/nnUNet_raw"
ENV nnUNet_preprocessed="/workspace/v2/nnUNet_preprocessed"
ENV nnUNet_results="/workspace/v2/nnUNet_results"

# SSH server
#RUN echo 'root:password' | chpasswd
#RUN echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
#RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
#ENTRYPOINT service ssh restart && env >> /etc/environment && bash
#EXPOSE 22

# Masonite
EXPOSE 8000

# jupyter
ENTRYPOINT jupyter-lab
EXPOSE 8888

# pynetdicom
EXPOSE 11120
