Dockerfile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. FROM php:8.3-fpm-bookworm
  2. 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. strace \
  34. vim \
  35. zip \
  36. zlib1g-dev \
  37. && rm -rf /var/lib/apt/lists/*
  38. RUN pecl channel-update pecl.php.net && pecl install \
  39. redis-6.0.2 \
  40. ssh2-1.3.1 \
  41. swoole-5.1.1 \
  42. xdebug-3.3.2 \
  43. && pecl clear-cache \
  44. && rm -rf /tmp/pear
  45. RUN curl -L https://github.com/Imagick/imagick/archive/28f27044e435a2b203e32675e942eb8de620ee58.zip -o imagick.zip \
  46. && unzip imagick.zip \
  47. && rm imagick.zip \
  48. && cd imagick-28f27044e435a2b203e32675e942eb8de620ee58 \
  49. && phpize \
  50. && ./configure --with-php-config=/usr/local/bin/php-config \
  51. && make \
  52. && make install \
  53. && echo "extension=imagick.so" >> $PHP_INI_DIR/conf.d/imagick.ini \
  54. && cd .. \
  55. && rm -rf imagick-28f27044e435a2b203e32675e942eb8de620ee58
  56. RUN docker-php-ext-configure \
  57. gd --with-freetype --with-jpeg --with-webp \
  58. && docker-php-ext-install \
  59. bcmath \
  60. bz2 \
  61. calendar \
  62. exif \
  63. gd \
  64. gettext \
  65. intl \
  66. mbstring \
  67. mysqli \
  68. opcache \
  69. pcntl \
  70. pdo_mysql \
  71. soap \
  72. sockets \
  73. sodium \
  74. sysvmsg \
  75. sysvsem \
  76. sysvshm \
  77. xsl \
  78. zip \
  79. && docker-php-ext-enable \
  80. imagick \
  81. redis \
  82. ssh2 \
  83. xdebug
  84. RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
  85. && architecture=$(uname -m) \
  86. && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/$architecture/$version \
  87. && mkdir -p /tmp/blackfire \
  88. && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
  89. && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
  90. && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
  91. RUN git clone --branch v0.4.15 --depth=1 https://github.com/NoiseByNorthwest/php-spx.git /usr/lib/php-spx \
  92. && cd /usr/lib/php-spx \
  93. && phpize \
  94. && ./configure \
  95. && make \
  96. && make install
  97. RUN curl -sS https://getcomposer.org/installer | \
  98. php -- --version=2.6.6 --install-dir=/usr/local/bin --filename=composer
  99. COPY conf/blackfire.ini $PHP_INI_DIR/conf.d/blackfire.ini
  100. COPY conf/spx.ini $PHP_INI_DIR/conf.d/spx.ini
  101. COPY conf/msmtprc /etc/msmtprc
  102. COPY conf/php.ini $PHP_INI_DIR
  103. COPY conf/php-fpm.conf /usr/local/etc/
  104. COPY conf/www.conf /usr/local/etc/php-fpm.d/
  105. USER app:app
  106. VOLUME /var/www
  107. WORKDIR /var/www/html