You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 satır
2.7KB

  1. FROM bingen/amd64-nginx-php
  2. ENV DEBIAN_FRONTEND=noninteractive
  3. ARG NEXTCLOUD_VERSION
  4. ARG NEXTCLOUD_DATA_PATH
  5. ARG NEXTCLOUD_BACKUP_PATH
  6. # php-gmp php-intl are needed for Bookmarks app
  7. RUN \
  8. wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \
  9. apt-get update && \
  10. apt-get install -y wget bzip2 vim rsync mariadb-client cron sudo php-imagick php7.4-gmp php7.4-intl && \
  11. apt-get clean
  12. # Change upload-limits and -sizes
  13. RUN sed -i "s/upload_max_filesize = 2M/upload_max_filesize = 2048M/g" /etc/php/7.4/fpm/php.ini && \
  14. sed -i "s/post_max_size = 8M/post_max_size =root123 2048M/g" /etc/php/7.4/fpm/php.ini && \
  15. echo 'default_charset = "UTF-8"' >> /etc/php/7.4/fpm/php.ini && \
  16. echo "upload_tmp_dir = ${NEXTCLOUD_DATA_PATH}" >> /etc/php/7.4/fpm/php.ini && \
  17. echo "extension = apc.so" >> /etc/php/7.4/fpm/php.ini && \
  18. echo "apc.enabled = 1" >> /etc/php/7.4/fpm/php.ini && \
  19. echo "apc.include_once_override = 0" >> /etc/php/7.4/fpm/php.ini && \
  20. echo "apc.shm_size = 256" >> /etc/php/7.4/fpm/php.ini
  21. # now add our hand-written nginx-default-configuration which makes use of all the stuff so far prepared
  22. COPY default /etc/nginx/sites-available/default
  23. # PHP config
  24. COPY php_nc.ini /tmp/php_nc.ini
  25. RUN cat /tmp/php_nc.ini >> /etc/php/7.4/fpm/php.ini && \
  26. cat /tmp/php_nc.ini >> /etc/php/7.4/cli/php.ini
  27. # https://docs.nextcloud.com/server/13/admin_manual/installation/source_installation.html#php-fpm-tips-label
  28. RUN sed -i 's/^;env/env/g' /etc/php/7.4/fpm/pool.d/www.conf
  29. # https://github.com/nextcloud/vm/issues/2039#issuecomment-876204446
  30. RUN echo "" >> /etc/php/7.4/mods-available/apcu.ini
  31. RUN echo "apc.enable_cli=1" >> /etc/php/7.4/mods-available/apcu.ini
  32. # Create the data-directory where NEXTCLOUD can store its stuff
  33. RUN mkdir -p "${NEXTCLOUD_DATA_PATH}" && \
  34. chown -R www-data:www-data "${NEXTCLOUD_DATA_PATH}" && \
  35. mkdir -p "${NEXTCLOUD_BACKUP_PATH}"
  36. # finally, download NEXTCLOUD and extract it
  37. RUN mkdir -p /var/www
  38. WORKDIR /var/www
  39. RUN wget https://download.nextcloud.com/server/releases/${NEXTCLOUD_VERSION}.tar.bz2 && \
  40. tar xvf ${NEXTCLOUD_VERSION}.tar.bz2 && \
  41. chown -R www-data:www-data nextcloud && \
  42. rm ${NEXTCLOUD_VERSION}.tar.bz2
  43. WORKDIR /
  44. COPY docker-entrypoint.sh /usr/local/bin/entrypoint.sh
  45. RUN chmod +x /usr/local/bin/entrypoint.sh
  46. COPY backup.sh /etc/cron.daily/backup
  47. RUN chmod +x /etc/cron.daily/backup
  48. RUN (crontab -l 2>/dev/null; echo "*/5 * * * * php -f /var/www/nextcloud/cron.php") | crontab -u www-data -
  49. #VOLUME ${NEXTCLOUD_DATA_PATH}
  50. #VOLUME ${NEXTCLOUD_BACKUP_PATH}
  51. ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
  52. CMD service php7.4-fpm start && nginx
  53. #CMD ["service", "php7.4-fpm", "start", "&&", "nginx"]