dumamai/java-fpm
0
1ARG VERSION=8.0.8-fpm-buster-nginx-1.21.12FROM dwchiang/nginx-php-fpm:8.0.8-fpm-buster-nginx-1.21.13 4ARG VERSION_PHP_MINOR5ARG VERSION_OS6ENV VERSION_OS=${VERSION_OS} 7 8### ----------------------------------------------------------9### PHP10### ----------------------------------------------------------11 12RUN set -x && \13 # install lib packages14 apt-get update --allow-releaseinfo-change &&\15 apt-get install --no-install-recommends --no-install-suggests -y \16 bc \17 # for bz218 # - ref: https://github.com/docker-library/php/issues/4719 libbz2-dev \20 # for gd21 # - ref: https://stackoverflow.com/questions/61228386/installing-gd-extension-in-docker22 libfreetype6-dev \23 libpng-dev \24 libjpeg62-turbo-dev \25 && \26 # install general usage packages27 apt-get install --no-install-recommends --no-install-suggests -y \28 # for composer29 git \30 && \31 # docker-php32 # - Removed `mbstring` on alpine: https://stackoverflow.com/questions/59251008/docker-laravel-configure-error-package-requirements-oniguruma-were-not-m/59253249#5925324933 # Due to this error: `configure: error: Package requirements (oniguruma) were not met: Package 'oniguruma', required by 'virtual:world', not found`34 # for gd35 # - ref: https://github.com/docker-library/php/pull/910#issuecomment-55938359736 if [ $(echo "${VERSION_PHP_MINOR} >= 7.4" | bc) -eq 1 ]; then \37 docker-php-ext-configure gd --with-freetype --with-jpeg ; \38 else \39 docker-php-ext-configure gd --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr ; \40 fi && \41 docker-php-ext-install -j$(nproc) \42 bcmath \43 mysqli \44 pdo \45 pdo_mysql \46 bz2 \47 gd \48 exif \49 opcache \50 && \51 docker-php-source delete && \52 # php configurations53 mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \54 # Memory, Time, Size Limits55 # You can limit these at your orchestration layer.56 echo "memory_limit=2048M" > $PHP_INI_DIR/conf.d/memory-limit.ini && \57 echo "max_execution_time=900" >> $PHP_INI_DIR/conf.d/memory-limit.ini && \58 echo "post_max_size=20M" >> $PHP_INI_DIR/conf.d/memory-limit.ini && \59 echo "upload_max_filesize=20M" >> $PHP_INI_DIR/conf.d/memory-limit.ini && \60 # Time Zone61 echo "date.timezone=${PHP_TIMEZONE:-UTC}" > $PHP_INI_DIR/conf.d/date_timezone.ini && \62 # Display errors in stderr63 echo "display_errors=stderr" > $PHP_INI_DIR/conf.d/display-errors.ini && \64 # Disable PathInfo65 echo "cgi.fix_pathinfo=0" > $PHP_INI_DIR/conf.d/path-info.ini && \66 # Disable expose PHP67 echo "expose_php=0" > $PHP_INI_DIR/conf.d/path-info.ini && \ 68 # composer69 curl -sS https://getcomposer.org/installer | php -- --quiet --install-dir=/usr/local/bin --filename=composer && \70 # clean up71 rm -rf /var/lib/apt/lists/* && \72 rm -rf /usr/share/nginx/html/*73 74### ----------------------------------------------------------75### Load our app76### ----------------------------------------------------------77 78COPY public /usr/share/nginx/html79COPY . /var/www/html80 81RUN mkdir /docker-entrypoint.d82RUN mkdir -p /var/log/supervisor83 84RUN set -x && \85 # We don't need hirak/prestissimo since composer 286 # if [ $(echo "${VERSION_PHP_MINOR} <= 7" | bc) -eq 1 ]; then \87 # composer global require hirak/prestissimo ; \88 # fi && \89 if [ -f "/var/www/html/composer.lock" ]; then \90 if [ "${APP_ENV}" == "development" ] || [ "${APP_ENV}" == "dev" || "${APP_ENV}" == "staging" ] || [ "${APP_ENV}" == "stage" ]; then \91 composer install --working-dir=/var/www/html ; \92 else \93 composer install --no-dev --working-dir=/var/www/html ; \94 fi \95 fi && \96 # resolve: The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied97 touch /var/www/html/storage/logs/laravel.log && \98 touch /var/log/cron.log && \99 # please remove this APP_KEY generate for your production usage100 # - ref: https://tighten.co/blog/app-key-and-you/101 php artisan key:generate && \ 102 chown -R www-data:www-data /usr/share/nginx/html && \103 chown -R www-data:www-data /var/www/html && \104 find /var/www/html/storage -type f -exec chmod 664 {} \; && \105 find /var/www/html/storage -type d -exec chmod 770 {} \;106 107 108 109 110COPY scripts/docker-entrypoint.sh /111COPY scripts/10-listen-on-ipv6-by-default.sh /docker-entrypoint.d112COPY scripts/20-envsubst-on-templates.sh /docker-entrypoint.d113COPY scripts/30-tune-worker-processes.sh /docker-entrypoint.d114 115COPY conf/nginx/nginx-site.conf /etc/nginx/nginx.conf116COPY conf/nginx/nginx-site.conf /etc/nginx/conf.d/default.conf117 118USER root119RUN mkdir -p -m 0700 /root/.ssh120 121RUN chmod -R 777 /var/run122 123EXPOSE 7860124 125CMD ["/docker-entrypoint.sh"]126 