|
| 1 | +# Based on https://github.com/Cyber-Duck/php-fpm-laravel/tree/7.2 |
| 2 | +FROM php:7.4-fpm |
| 3 | + |
| 4 | +ENV XDEBUG="false" |
| 5 | + |
| 6 | +RUN apt-get update && \ |
| 7 | + apt-get install -y --force-yes --no-install-recommends \ |
| 8 | + libmemcached-dev \ |
| 9 | + libz-dev \ |
| 10 | + libpq-dev \ |
| 11 | + libjpeg-dev \ |
| 12 | + libpng-dev \ |
| 13 | + libfreetype6-dev \ |
| 14 | + libssl-dev \ |
| 15 | + libmcrypt-dev \ |
| 16 | + openssh-server \ |
| 17 | + libmagickwand-dev \ |
| 18 | + git \ |
| 19 | + cron \ |
| 20 | + nano \ |
| 21 | + libxml2-dev |
| 22 | + |
| 23 | + |
| 24 | +RUN docker-php-ext-install \ |
| 25 | + soap \ |
| 26 | + pcntl \ |
| 27 | + pdo_mysql \ |
| 28 | + pdo_pgsql \ |
| 29 | + bcmath |
| 30 | + |
| 31 | +RUN pecl install imagick && \ |
| 32 | + docker-php-ext-enable imagick |
| 33 | + |
| 34 | +RUN docker-php-ext-configure gd \ |
| 35 | + --with-freetype \ |
| 36 | + --with-jpeg && \ |
| 37 | + docker-php-ext-install gd |
| 38 | + |
| 39 | +RUN docker-php-ext-install exif && \ |
| 40 | + docker-php-ext-configure exif \ |
| 41 | + --enable-exif |
| 42 | + |
| 43 | +# Install the xdebug extension |
| 44 | +RUN pecl install xdebug && docker-php-ext-enable xdebug |
| 45 | +# Copy xdebug configration for remote debugging |
| 46 | +COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini |
| 47 | + |
| 48 | +# Install the php memcached extension |
| 49 | +RUN pecl install memcached && docker-php-ext-enable memcached |
| 50 | + |
| 51 | +# Install composer and add its bin to the PATH. |
| 52 | +RUN curl -s http://getcomposer.org/installer | php && \ |
| 53 | + echo "export PATH=${PATH}:/var/www/vendor/bin" >> ~/.bashrc && \ |
| 54 | + mv composer.phar /usr/local/bin/composer |
| 55 | + |
| 56 | +# Source the bash |
| 57 | +RUN . ~/.bashrc |
| 58 | + |
| 59 | + |
| 60 | +ADD ./php_fpm.ini /usr/local/etc/php/conf.d |
| 61 | + |
| 62 | +RUN rm -r /var/lib/apt/lists/* |
| 63 | + |
| 64 | +RUN usermod -u 1000 www-data |
| 65 | + |
| 66 | +WORKDIR /var/www |
| 67 | + |
| 68 | +COPY ./docker-entrypoint.sh /usr/local/bin/ |
| 69 | +RUN chmod +x /usr/local/bin/docker-entrypoint.sh |
| 70 | +RUN ln -s /usr/local/bin/docker-entrypoint.sh / |
| 71 | +ENTRYPOINT ["docker-entrypoint.sh"] |
| 72 | + |
| 73 | +EXPOSE 9000 |
| 74 | +CMD ["php-fpm"] |
0 commit comments