Dockerfile 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. FROM ubuntu:focal
  2. ENV DEBIAN_FRONTEND=noninteractive
  3. ENV TERM=xterm
  4. ENV LANG=ru_RU.UTF-8
  5. ENV container=docker
  6. RUN echo '#!/bin/sh' > /usr/sbin/policy-rc.d \
  7. && echo 'exit 101' >> /usr/sbin/policy-rc.d \
  8. && chmod +x /usr/sbin/policy-rc.d \
  9. && dpkg-divert --local --rename --add /sbin/initctl \
  10. && cp -a /usr/sbin/policy-rc.d /sbin/initctl \
  11. && sed -i 's/^exit.*/exit 0/' /sbin/initctl \
  12. && echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup \
  13. && echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' > /etc/apt/apt.conf.d/docker-clean \
  14. && echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' >> /etc/apt/apt.conf.d/docker-clean \
  15. && echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' >> /etc/apt/apt.conf.d/docker-clean \
  16. && echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/docker-no-languages \
  17. && echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > /etc/apt/apt.conf.d/docker-gzip-indexes \
  18. && echo 'Apt::AutoRemove::SuggestsImportant "false";' > /etc/apt/apt.conf.d/docker-autoremove-suggests \
  19. && sed -i 's/# deb/deb/g' /etc/apt/sources.list \
  20. && apt-get update \
  21. && apt-get -yf --no-install-recommends install \
  22. gnupg software-properties-common dpkg-dev wget curl iptables nano mc iputils-ping locales ca-certificates pwgen apt-utils iproute2 net-tools \
  23. && sed -i -e 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen \
  24. && dpkg-reconfigure --frontend=noninteractive locales \
  25. && update-locale LANG=ru_RU.UTF-8
  26. ENV LANG ru_RU.UTF-8
  27. RUN mv /usr/bin/systemctl /usr/bin/systemctl.original
  28. COPY systemctl-wrapper /usr/bin/systemctl
  29. WORKDIR /root
  30. RUN wget "https://raw.githubusercontent.com/hestiacp/hestiacp/1.5.10/install/hst-install-ubuntu.sh" \
  31. && pwgen -c -n -1 12 > $HOME/.delme \
  32. && bash hst-install-ubuntu.sh \
  33. --apache no --vsftpd no --proftpd no --named no --mysql no --postgresql no --exim yes --dovecot no \
  34. --sieve no --clamav no --spamassassin no --iptables no --fail2ban no --quota no --with-debs no \
  35. --interactive no \
  36. --phpfpm yes --multiphp yes --api yes \
  37. --email admin@hoster.0ln.ru --port 8083 --hostname hoster.0ln.ru --password $(cat $HOME/.delme) --lang ru \
  38. && apt-get -yf autoremove \
  39. && apt-get clean \
  40. && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  41. RUN wget "https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/develop/files/docker/systemctl3.py" -O /usr/bin/systemctl \
  42. && chmod +x /usr/bin/systemctl \
  43. && mkdir -p /run/systemd/system/ \
  44. && systemctl disable ssh
  45. VOLUME ["/usr/local/hestia", "/home", "/backup"]
  46. EXPOSE 80 443 8083
  47. CMD ["/usr/bin/systemctl"]