Sign inSign up

itworkplace/php

By itworkplace

•Updated 4 months ago

PHP-FPM with ZTS support. Built-in HTTP server on Alpine Linux

Image
Web servers
0

174

itworkplace/php repository overview

Clean Built-in HTTP server on latest Alpine Linux. PHP 8.4.22 FPM with ZTS support. Files .htaccess is not supported

⁠docker-compose.yml example:

php-fpm:
  image: itworkplace/php:8.4.22-fpm-clean
  # image: itworkplace/php:8.5.7-fpm-clean
  # or image: your-custom-image:version
  container_name: php-fpm
  hostname: php-fpm
  cpu_count: "1"
  mem_limit: "256M"
  memswap_limit: "1G"
  ports:
    - 1234:9000
  # build:
    # context: ./php-fpm
    # dockerfile: php-fpm.Dockerfile
  volumes:
    - ./php-fpm/php.ini-development:/usr/local/etc/php/php.ini
    # - ./php-fpm/php.ini-production:/usr/local/etc/php/php.ini
    - ./php-fpm/www:/www
  command: php -S 0.0.0.0:9000 -t .
  restart: always
  networks:
    test_net:
      ipv4_address: 123.45.0.2

networks:
  test_net:
    name: "test_net"
    driver: bridge
    ipam:
      config:
        - subnet: 123.45.0.0/16
          gateway: 123.45.0.1

⁠Dockerfile for adding all modules:

FROM itworkplace/php:8.4.22-fpm-clean
# FROM itworkplace/php:8.5.7-fpm-clean

COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

# The order of installing modules is very important!
RUN apk update && apk upgrade; \
  install-php-extensions amqp apcu bcmath bz2 calendar csv exif ftp gd imap intl json_post jsonpath ldap lz4 lzf mailparse mcrypt md4c memcache memcached mysqli pdo_mysql oauth opcache pspell redis sockets spx ssh2 timezonedb uuid vips xdebug xsl yaml zip zstd

# Imagick
RUN apk add --no-cache alpine-sdk autoconf automake libtool build-base php-pear php84-dev imagemagick-dev php-imagick ghostscript-dev libjpeg-turbo-dev libpng-dev libwebp-dev freetype-dev; \
  pecl update-channels; \
  pecl install imagick; \
  mv /etc/php84/conf.d/imagick.ini /usr/local/etc/php/conf.d/docker-php-ext-imagick.ini
  # mv /etc/php85/conf.d/imagick.ini /usr/local/etc/php/conf.d/docker-php-ext-imagick.ini

# Composer
RUN install-php-extensions @composer

STOPSIGNAL SIGQUIT
EXPOSE 9000
CMD ["php-fpm"]

Tag summary

Content type

Image

Digest

sha256:085c57494…

Size

44.7 MB

Last updated

4 months ago

docker pull itworkplace/php:8.4.22-fpm-clean