Skip to content

Instantly share code, notes, and snippets.

@KrisKnez
Created February 13, 2025 13:38
Show Gist options
  • Save KrisKnez/35c1006b60a35028a747219a17bdd0cb to your computer and use it in GitHub Desktop.
Save KrisKnez/35c1006b60a35028a747219a17bdd0cb to your computer and use it in GitHub Desktop.
PHP 7.4 DEV ENV
FROM php:7.4-apache AS final
# Install system dependencies required for PHP extensions
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libonig-dev \
libzip-dev \
zip \
unzip \
libxml2-dev \
libmcrypt-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd mbstring mysqli pdo pdo_mysql zip xml \
&& pecl install mcrypt-1.0.4 \
&& docker-php-ext-enable mcrypt \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Use development-optimized PHP configuration
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
# Enable Apache mod_rewrite
RUN a2enmod rewrite
# Set the user to www-data for security
USER www-data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment