forked from Eshe/competition-vd
47 lines
1.2 KiB
Plaintext
Executable File
47 lines
1.2 KiB
Plaintext
Executable File
FROM nvidia/cuda:11.8.0-base-ubuntu22.04
|
|
|
|
ENV PYTHON_VERSION=3.9
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
ENV PATH /opt/conda/bin:$PATH
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
wget \
|
|
ca-certificates \
|
|
git \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
|
|
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
|
|
rm ~/miniconda.sh && \
|
|
/opt/conda/bin/conda clean -tipsy && \
|
|
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
|
|
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
|
|
echo "conda activate base" >> ~/.bashrc
|
|
|
|
RUN conda install -y python=$PYTHON_VERSION && \
|
|
conda clean -tipsy
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt /app/
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt && \
|
|
pip install --no-cache-dir jupyterlab
|
|
|
|
COPY . /app
|
|
|
|
RUN useradd -m -s /bin/bash ml-user && \
|
|
chown -R ml-user:ml-user /app
|
|
|
|
USER ml-user
|
|
|
|
RUN mkdir -p /app/models /app/data /app/output
|
|
|
|
ENV PYTHONPATH=/app:$PYTHONPATH
|
|
ENV CUDA_VISIBLE_DEVICES=0,1
|
|
|
|
EXPOSE 8888
|
|
|
|
ENTRYPOINT ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]
|
|
|
|
CMD ["python", "main.py"] |