Dockerfile 3.0 KB

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