Dockerfile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. FROM SXKJ:32775/yiliocr-layout:test-2023-08-26_11-57-27
  2. WORKDIR /workspace
  3. RUN rm -rf ./*
  4. ADD requirements.txt .
  5. RUN ln -s /opt/conda/bin/pip /usr/local/bin/pip
  6. RUN pip install -r requirements.txt -i https://mirror.baidu.com/pypi/simple
  7. # ADD environment.yml /environment.yml
  8. # RUN sed -i 's#- paddlepaddle#- paddlepaddle-gpu==2.3.0.post110#g' /environment.yml && cat /environment.yml
  9. #RUN conda update -n base -c defaults conda -y && conda env update -f /environment.yml && rm -rf /root/.cache
  10. # RUN mamba update -n base -c defaults conda -y && mamba env create -f /environment.yml && rm -rf /root/.cache
  11. RUN echo "\
  12. [program:be]\n\
  13. directory=/workspace\n\
  14. command=/opt/conda/bin/python run.py \n\
  15. autorestart=true\n\
  16. startretries=0\n\
  17. redirect_stderr=true\n\
  18. stdout_logfile=/var/log/be.log\n\
  19. stdout_logfile_maxbytes=50MB\n\
  20. environment=CUDA_VISIBLE_DEVICES=0,PYTHONPATH=/worksapce/yolov7\n\
  21. " > /etc/supervisor/conf.d/be.conf
  22. # envs/py38/
  23. RUN git clone http://gogs.soaringnova.com/sxwl_DL/yolov7.git
  24. RUN wget ftp://192.168.199.31/yiliv7_718.pt
  25. # RUN wget ftp://192.168.199.31/logo.pt
  26. RUN mkdir -p models
  27. RUN cd models && wget ftp://192.168.199.31/yolov7p6_e6_300e/20240314/yolov7p6_e6_300e_coco.zip && unzip yolov7p6_e6_300e_coco.zip && rm yolov7p6_e6_300e_coco.zip
  28. # FIXME: replace with environment variables
  29. RUN sed -i 's/device = "cpu"/device = "gpu"/g' core/detectors/paddle_yolo/__init__.py && cat core/detectors/paddle_yolo/__init__.py
  30. ADD . /workspace
  31. EXPOSE 8080
  32. # RUN mamba install -y jupyterlab -n base && mamba init zsh
  33. # RUN /opt/conda/bin/jupyter notebook --generate-config && \
  34. # echo "c.NotebookApp.password='argon2:\$argon2id\$v=19\$m=10240,t=10,p=8\$+zIUCF9Uk2FiCHlV8njX5A\$I5Mm/64DORArcXYTXWRVng'">>/root/.jupyter/jupyter_notebook_config.py
  35. # RUN mkdir -p /data && echo "\
  36. # [program:jupyter]\n\
  37. # directory=/data\n\
  38. # command=/opt/conda/bin/jupyter lab --ip 0.0.0.0 --port 8888 --allow-root --no-browser \n\
  39. # autorestart=true\n\
  40. # startretries=0\n\
  41. # redirect_stderr=true\n\
  42. # stdout_logfile=/dev/stdout\n\
  43. # stdout_logfile_maxbytes=0\n\
  44. # " > /etc/supervisor/conf.d/jupyter.conf
  45. # EXPOSE 8888