123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- FROM condaforge/mambaforge:latest AS builder0
- #FROM nvidia/cuda:11.0-cudnn8-devel-ubuntu18.04 AS builder
- FROM SXKJ:32775/nvidia-cuda-11.0-cudnn8.0:latest AS builder
- RUN sed -i 's#archive.ubuntu.com#mirrors.aliyun.com#g' /etc/apt/sources.list \
- && sed -i 's#security.ubuntu.com#mirrors.aliyun.com#g' /etc/apt/sources.list
- ENV LANG=zh_CN.UTF-8 LANGUAGE=zh_CN:zh LC_ALL=zh_CN.UTF-8 DEBIAN_FRONTEND=noninteractive
- RUN rm -rf /etc/apt/sources.list.d/ && apt update
- RUN apt-get update && apt-get install -y --no-install-recommends \
- supervisor \
- iputils-ping \
- wget \
- zsh \
- build-essential \
- cmake \
- git \
- curl \
- vim \
- ca-certificates \
- libjpeg-dev \
- zip \
- unzip \
- libpng-dev \
- openssh-server \
- autojump \
- language-pack-zh-hans \
- ttf-wqy-zenhei \
- libgl1-mesa-glx \
- libglib2.0-0 \
- locales &&\
- rm -rf /var/lib/apt/lists/*
- RUN locale-gen zh_CN.UTF-8
- RUN dpkg-reconfigure locales
- CMD ["supervisord", "-n"]
- FROM builder as builder1
- # ENV PYTHON_VERSION 3
- # RUN chsh -s `which zsh`
- # RUN curl -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda${PYTHON_VERSION}-latest-Linux-x86_64.sh && \
- # chmod +x ~/miniconda.sh && \
- # ~/miniconda.sh -b -p /opt/conda && \
- # rm ~/miniconda.sh
- COPY --from=builder0 /opt/conda /opt/conda
- RUN ln /opt/conda/bin/conda /usr/local/bin/conda
- RUN conda init zsh
- # RUN conda install 'mamba<=1.4.5' -n base -c conda-forge
- RUN ln /opt/conda/bin/mamba /usr/local/bin/mamba && mamba init zsh
- FROM builder1 as builder2
- RUN apt-get update && apt-get install -y --no-install-recommends openssh-server && rm -rf /var/lib/apt/lists/*
- RUN mkdir /var/run/sshd
- RUN echo 'root:root' | chpasswd
- RUN sed -i 's/.*PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config
- # SSH login fix. Otherwise user is kicked off after login
- RUN sed -i 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' /etc/pam.d/sshd
- RUN echo "\
- [program:sshd] \n\
- command=/usr/sbin/sshd -D\n\
- autorestart=True\n\
- autostart=True\n\
- redirect_stderr = true\n\
- " > /etc/supervisor/conf.d/sshd.conf
- EXPOSE 22
- FROM builder2 as builder3
- WORKDIR /workspace
- ADD environment.yml /environment.yml
- RUN sed -i 's#- paddlepaddle#- paddlepaddle-gpu==2.3.0.post110#g' /environment.yml && cat /environment.yml
- RUN mamba update -n base -c defaults conda -y && mamba env create -f /environment.yml && rm -rf /root/.cache
- # RUN /opt/conda/envs/py38/bin/python -m ipykernel install --name py38 --display-name "py38"
- # RUN echo "c.MultiKernelManager.default_kernel_name = 'py38'">>/root/.jupyter/jupyter_notebook_config.py
- RUN mkdir -p /var/log/be
- RUN echo "\
- [program:be]\n\
- directory=/workspace\n\
- command=/opt/conda/envs/py38/bin/python run.py \n\
- autorestart=true\n\
- startretries=0\n\
- redirect_stderr=true\n\
- stdout_logfile=/var/log/be/be.log\n\
- stdout_logfile_maxbytes=50MB\n\
- " > /etc/supervisor/conf.d/be.conf
- RUN cd / && wget ftp://192.168.199.31/table-paddleclas.tgz && tar xvf table-paddleclas.tgz
- RUN cd / && wget ftp://192.168.199.31/table-paddleocr.tgz && tar xvf table-paddleocr.tgz
- RUN cd models/det && wget ftp://192.168.199.31/det_pse/quad/20240205/det_pse.zip && unzip det_pse.zip -d tmp && mv tmp/det_pse det_pse_quad && rm -r tmp && rm det_pse.zip
- RUN sed -i "s#os.chdir('ppocr/postprocess/pse_postprocess/pse')#os.chdir('PaddleOCR/ppocr/postprocess/pse_postprocess/pse')#g" PaddleOCR/ppocr/postprocess/pse_postprocess/pse/__init__.py; \
- cat PaddleOCR/ppocr/postprocess/pse_postprocess/pse/__init__.py
- Add . /workspace
- EXPOSE 8080
- # RUN mamba install -y jupyterlab -n base && mamba init zsh
- # RUN /opt/conda/bin/jupyter notebook --generate-config && \
- # echo "c.NotebookApp.password='argon2:\$argon2id\$v=19\$m=10240,t=10,p=8\$+zIUCF9Uk2FiCHlV8njX5A\$I5Mm/64DORArcXYTXWRVng'">>/root/.jupyter/jupyter_notebook_config.py
- # RUN mkdir -p /data && echo "\
- # [program:jupyter]\n\
- # directory=/data\n\
- # command=/opt/conda/bin/jupyter lab --ip 0.0.0.0 --port 8888 --allow-root --no-browser \n\
- # autorestart=true\n\
- # startretries=0\n\
- # redirect_stderr=true\n\
- # stdout_logfile=/dev/stdout\n\
- # stdout_logfile_maxbytes=0\n\
- # " > /etc/supervisor/conf.d/jupyter.conf
- # EXPOSE 8888
|