Dockerfile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. FROM php:8.4-fpm-bookworm
  2. LABEL maintainer="Mark Shust <mark@shust.com>"
  3. ARG APP_ID=1000
  4. RUN groupadd -g "$APP_ID" app \
  5. && useradd -g "$APP_ID" -u "$APP_ID" -d /var/www -s /bin/bash app
  6. RUN mkdir -p /etc/nginx/html /var/www/html /sock \
  7. && chown -R app:app /etc/nginx /var/www /usr/local/etc/php/conf.d /sock
  8. RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
  9. RUN apt-get update && apt-get install -y \
  10. cron \
  11. default-mysql-client \
  12. git \
  13. gnupg \
  14. gzip \
  15. libbz2-dev \
  16. libfreetype6-dev \
  17. libicu-dev \
  18. libjpeg62-turbo-dev \
  19. libmagickwand-dev \
  20. libmcrypt-dev \
  21. libonig-dev \
  22. libpng-dev \
  23. libsodium-dev \
  24. libssh2-1-dev \
  25. libwebp-dev \
  26. libxslt1-dev \
  27. libzip-dev \
  28. lsof \
  29. mailutils \
  30. msmtp \
  31. nodejs \
  32. procps \
  33. rsync \
  34. strace \
  35. vim \
  36. zip \
  37. zlib1g-dev \
  38. && rm -rf /var/lib/apt/lists/*
  39. RUN pecl channel-update pecl.php.net \
  40. && pecl install redis-6.1.0 \
  41. && pecl install ssh2-1.4.1 \
  42. && pecl install swoole-6.0.0RC1 \
  43. && pecl install xdebug-3.4.0beta1 \
  44. && pecl clear-cache \
  45. && rm -rf /tmp/pear
  46. RUN imagick_branch="28f27044e435a2b203e32675e942eb8de620ee58" \
  47. && curl -L https://github.com/Imagick/imagick/archive/$imagick_branch.zip -o imagick.zip \
  48. && unzip imagick.zip \
  49. && rm imagick.zip \
  50. && cd imagick-$imagick_branch \
  51. && phpize \
  52. && ./configure --with-php-config=/usr/local/bin/php-config \
  53. && make \
  54. && make install \
  55. && echo "extension=imagick.so" >> $PHP_INI_DIR/conf.d/imagick.ini \
  56. && cd .. \
  57. && rm -rf imagick-$imagick_branch
  58. RUN docker-php-ext-configure \
  59. gd --with-freetype --with-jpeg --with-webp \
  60. && docker-php-ext-install \
  61. bcmath \
  62. bz2 \
  63. calendar \
  64. exif \
  65. ftp \
  66. gd \
  67. gettext \
  68. intl \
  69. mbstring \
  70. mysqli \
  71. opcache \
  72. pcntl \
  73. pdo_mysql \
  74. soap \
  75. sockets \
  76. sodium \
  77. sysvmsg \
  78. sysvsem \
  79. sysvshm \
  80. xsl \
  81. zip \
  82. && docker-php-ext-enable \
  83. imagick \
  84. redis \
  85. ssh2 \
  86. xdebug
  87. # Temporary workaround for PHP 8.4
  88. RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
  89. && version=83 \
  90. && architecture=$(uname -m) \
  91. && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/$architecture/$version \
  92. && mkdir -p /tmp/blackfire \
  93. && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
  94. && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
  95. && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
  96. RUN git clone --branch v0.4.17 --depth=1 https://github.com/NoiseByNorthwest/php-spx.git /usr/lib/php-spx \
  97. && cd /usr/lib/php-spx \
  98. && phpize \
  99. && ./configure \
  100. && make \
  101. && make install
  102. RUN curl -sS https://getcomposer.org/installer | \
  103. php -- --version=2.7.9 --install-dir=/usr/local/bin --filename=composer
  104. COPY conf/blackfire.ini $PHP_INI_DIR/conf.d/blackfire.ini
  105. COPY conf/spx.ini $PHP_INI_DIR/conf.d/spx.ini
  106. COPY conf/msmtprc /etc/msmtprc
  107. COPY conf/php.ini $PHP_INI_DIR
  108. COPY conf/php-fpm.conf /usr/local/etc/
  109. COPY conf/www.conf /usr/local/etc/php-fpm.d/
  110. USER app:app
  111. VOLUME /var/www
  112. WORKDIR /var/www/html