Dockerfile 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # docker build -t qwerty/oas:latest .
  2. # docker run -v ${PWD}:/app/OnmyojiAutoScript -p 22288:22288 --name oas -it --rm qwerty/oas
  3. FROM python:3.10-slim-bookworm
  4. WORKDIR /app/OnmyojiAutoScript
  5. COPY requirements.txt /tmp/requirements.txt
  6. # python:3.10-slim is based on debian:12, apt source from https://developer.aliyun.com/mirror/debian
  7. RUN echo "\
  8. deb https://mirrors.cloud.tencent.com/debian/ bookworm main non-free non-free-firmware contrib \n\
  9. deb-src https://mirrors.cloud.tencent.com/debian/ bookworm main non-free non-free-firmware contrib \n\
  10. deb https://mirrors.cloud.tencent.com/debian-security/ bookworm-security main \n\
  11. deb-src https://mirrors.cloud.tencent.com/debian-security/ bookworm-security main \n\
  12. deb https://mirrors.cloud.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib \n\
  13. deb-src https://mirrors.cloud.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib \n\
  14. deb https://mirrors.cloud.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib \n\
  15. deb-src https://mirrors.cloud.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib \
  16. "\
  17. > /etc/apt/sources.list\
  18. && apt update \
  19. && apt install -y git adb libgomp1 openssh-client \
  20. && git config --global --add safe.directory '*' \
  21. && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
  22. && echo 'Asia/Shanghai' > /etc/timezone \
  23. && pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
  24. && pip install -r /tmp/requirements.txt \
  25. && pip uninstall -y opencv-python\
  26. && pip uninstall -y opencv-python-headless\
  27. && pip install opencv-python-headless==4.7.0.72\
  28. && rm /tmp/requirements.txt \
  29. && rm -r ~/.cache/pip
  30. CMD python server.py
  31. #CMD /bin/bash