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.

127 lines
3.8 KiB

3 years ago
  1. # DO NOT EDIT: created by update.sh from Dockerfile-alpine.template
  2. FROM php:7.4-fpm-alpine3.12
  3. # entrypoint.sh and cron.sh dependencies
  4. RUN set -ex; \
  5. \
  6. apk add --no-cache \
  7. rsync \
  8. ; \
  9. \
  10. rm /var/spool/cron/crontabs/root; \
  11. echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data
  12. # install the PHP extensions we need
  13. # see https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html
  14. RUN set -ex; \
  15. \
  16. apk add --no-cache --virtual .build-deps \
  17. $PHPIZE_DEPS \
  18. autoconf \
  19. freetype-dev \
  20. icu-dev \
  21. libevent-dev \
  22. libjpeg-turbo-dev \
  23. libmcrypt-dev \
  24. libpng-dev \
  25. libmemcached-dev \
  26. libxml2-dev \
  27. libzip-dev \
  28. openldap-dev \
  29. pcre-dev \
  30. postgresql-dev \
  31. imagemagick-dev \
  32. libwebp-dev \
  33. gmp-dev \
  34. ; \
  35. \
  36. docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \
  37. docker-php-ext-configure ldap; \
  38. docker-php-ext-install -j "$(nproc)" \
  39. bcmath \
  40. exif \
  41. gd \
  42. intl \
  43. ldap \
  44. opcache \
  45. pcntl \
  46. pdo_mysql \
  47. pdo_pgsql \
  48. zip \
  49. gmp \
  50. ; \
  51. \
  52. # pecl will claim success even if one install fails, so we need to perform each install separately
  53. pecl install APCu-5.1.19; \
  54. pecl install memcached-3.1.5; \
  55. pecl install redis-5.3.2; \
  56. pecl install imagick-3.4.4; \
  57. \
  58. docker-php-ext-enable \
  59. apcu \
  60. memcached \
  61. redis \
  62. imagick \
  63. ; \
  64. \
  65. runDeps="$( \
  66. scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
  67. | tr ',' '\n' \
  68. | sort -u \
  69. | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
  70. )"; \
  71. apk add --virtual .nextcloud-phpext-rundeps $runDeps; \
  72. apk del .build-deps
  73. # set recommended PHP.ini settings
  74. # see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html#enable-php-opcache
  75. RUN { \
  76. echo 'opcache.enable=1'; \
  77. echo 'opcache.interned_strings_buffer=8'; \
  78. echo 'opcache.max_accelerated_files=10000'; \
  79. echo 'opcache.memory_consumption=128'; \
  80. echo 'opcache.save_comments=1'; \
  81. echo 'opcache.revalidate_freq=1'; \
  82. } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
  83. \
  84. echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
  85. \
  86. echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \
  87. \
  88. mkdir /var/www/data; \
  89. chown -R www-data:root /var/www; \
  90. chmod -R g=u /var/www
  91. VOLUME /var/www/html
  92. ENV NEXTCLOUD_VERSION 20.0.1
  93. RUN set -ex; \
  94. apk add --no-cache --virtual .fetch-deps \
  95. bzip2 \
  96. gnupg \
  97. ; \
  98. \
  99. curl -fsSL -o nextcloud.tar.bz2 \
  100. "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2"; \
  101. curl -fsSL -o nextcloud.tar.bz2.asc \
  102. "https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2.asc"; \
  103. export GNUPGHOME="$(mktemp -d)"; \
  104. # gpg key from https://nextcloud.com/nextcloud.asc
  105. gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
  106. gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
  107. tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
  108. gpgconf --kill all; \
  109. rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
  110. rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
  111. mkdir -p /usr/src/nextcloud/data; \
  112. mkdir -p /usr/src/nextcloud/custom_apps; \
  113. chmod +x /usr/src/nextcloud/occ; \
  114. apk del .fetch-deps
  115. COPY *.sh upgrade.exclude /
  116. COPY config/* /usr/src/nextcloud/config/
  117. ENTRYPOINT ["/entrypoint.sh"]
  118. CMD ["php-fpm"]