Dockerfile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. RUN python${PYTHON_VERSION} -m venv $HOME/python3
  24. RUN echo 'source $HOME/python3/bin/activate' >> $HOME/.bashrc
  25. # https://pip.pypa.io/en/stable/installation/#get-pip-py
  26. ADD --chown=deploy https://bootstrap.pypa.io/get-pip.py /opt/
  27. RUN bash -c "source $HOME/python3/bin/activate && python3 /opt/get-pip.py"
  28. # COPY --chown=deploy README.md pyproject.toml /opt/ai-translate/
  29. # COPY --chown=deploy ai_translate /opt/ai-translate/ai_translate
  30. # RUN bash -c "source $HOME/python3/bin/activate && python3 -m pip install -e /opt/ai-translate"
  31. RUN echo "$(date -u +%4Y%m%d%H%M%S)" | sudo tee /VERSION
  32. VOLUME /srv
  33. WORKDIR /srv
  34. CMD ["/bin/bash", "-l"]