Dockerfile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. FROM ubuntu:latest
  2. LABEL maintainer="Kassapa"
  3. ENV DEBIAN_FRONTEND noninteractive
  4. # https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
  5. ARG PYTHON_VERSION=3.13
  6. RUN apt update
  7. RUN apt -y install lsb-release apt-utils \
  8. debian-keyring debian-archive-keyring apt-transport-https software-properties-common curl wget gnupg
  9. RUN add-apt-repository -y ppa:deadsnakes/ppa
  10. RUN apt -y upgrade
  11. RUN apt -y install git vim sudo locales locales-all tzdata build-essential \
  12. python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv
  13. RUN apt -y autoremove
  14. RUN apt -y clean
  15. RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
  16. RUN locale-gen
  17. RUN update-locale LANG=en_US.UTF-8
  18. RUN update-alternatives --set editor /usr/bin/vim.basic
  19. # RUN useradd -s /bin/bash -m deploy
  20. # RUN passwd -l deploy
  21. # RUN echo 'deploy ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/101-deploy
  22. # USER deploy
  23. # ADD --chown=deploy https://bootstrap.pypa.io/get-pip.py /opt/
  24. RUN python${PYTHON_VERSION} -m venv $HOME/python3
  25. RUN echo 'source $HOME/python3/bin/activate' >> $HOME/.bashrc
  26. # https://pip.pypa.io/en/stable/installation/#get-pip-py
  27. ADD https://bootstrap.pypa.io/get-pip.py /opt/
  28. RUN bash -c ". $HOME/python3/bin/activate && python3 /opt/get-pip.py"
  29. RUN bash -c ". $HOME/python3/bin/activate && pip install pika requests redis[hiredis] openai"
  30. # COPY --chown=deploy README.md pyproject.toml /opt/ai-translate/
  31. # COPY --chown=deploy ai_translate /opt/ai-translate/ai_translate
  32. # RUN bash -c "source $HOME/python3/bin/activate && python3 -m pip install -e /opt/ai-translate"
  33. RUN echo "$(date -u +%4Y%m%d%H%M%S)" | sudo tee /VERSION
  34. VOLUME /srv
  35. WORKDIR /srv
  36. CMD ["/bin/bash", "-l"]