Skip to content

Instantly share code, notes, and snippets.

@eS-IT
Last active December 23, 2018 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eS-IT/d7c7fafbc36798f35ce5dc90c1aa0199 to your computer and use it in GitHub Desktop.
Save eS-IT/d7c7fafbc36798f35ce5dc90c1aa0199 to your computer and use it in GitHub Desktop.
Dockerfile71 für die PHP-Version 7.1 im Setup 2018
##
## PHP-Image festelegen
##
FROM php:7.1-apache
##
## Maintainer setzen
##
LABEL maintainer="patrick.froch@easySolutionsIT.de"
##
## ARGS
##
ARG APACHE_RUN_USER=1000
ARG APACHE_RUN_GROUP=1000
##
## User und Gruppe mit den richtigen ids erstellen
RUN groupmod -g $APACHE_RUN_GROUP www-data && usermod -u $APACHE_RUN_USER -g $APACHE_RUN_GROUP www-data
##
## Zeitzone setzen
##
RUN ln -fs /usr/share/zoneinfo/Europe/Berlin /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
##
## Abhängigkeiten installieren
##
RUN apt-get update && apt-get upgrade -y && apt-get install --no-install-recommends -y libbz2-dev libc-client-dev libfreetype6-dev libgpgme11-dev libicu-dev libjpeg62-turbo-dev libkrb5-dev libmcrypt-dev libpng-dev libxml2-dev
##
## Core-Erweiterungen installieren
##
# Install bcmath
RUN docker-php-ext-install bcmath
# Install bz2 (need libbz2-dev)
RUN docker-php-ext-install bz2
# Install calendar
RUN docker-php-ext-install calendar
# Install exif
RUN docker-php-ext-install exif
# Install (need libfreetype6-dev libjpeg62-turbo-dev libpng-dev)
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd
# Install gettext
RUN docker-php-ext-install gettext
# Install imap (need libc-client-dev libkrb5-dev)
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl && docker-php-ext-install imap
# Install intl (need libicu-dev)
RUN docker-php-ext-configure intl && docker-php-ext-install intl
# Install mcrypt (need libmcrypt-dev)
RUN docker-php-ext-install mcrypt
# Install mysqli
RUN docker-php-ext-install mysqli
# Install pcntl
RUN docker-php-ext-install pcntl
# Install pod
RUN docker-php-ext-install pdo
# Install pdo_mysql
RUN docker-php-ext-install pdo_mysql
# Install soap (need libxml2-dev)
RUN docker-php-ext-install soap
# Install sockets
RUN docker-php-ext-install sockets
# Install (need zlib1g-dev)
RUN docker-php-ext-install zip
##
## PECL-Erweiterungen installieren
##
# Install mcrypt (need libmcrypt-dev) (erst ab PHP 7.2)
# RUN pecl install mcrypt-1.0.1 && docker-php-ext-enable mcrypt
# Install xdebug
RUN pecl install xdebug-2.6.1
# Install gnupg (need libgpgme11-dev)
RUN pecl install gnupg-1.4.0
##
## php.ini auf Vorlage für Entwicklung umstellen
##
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
##
## php.ini einfügen
##
COPY etc/php-71.ini $PHP_INI_DIR/conf.d/
##
## Apache-Konfiguration einbinden
##
COPY sites-enabled/8071-default.conf /etc/apache2/sites-available/000-default.conf
##
## Enable vhosts
##
RUN a2enmod vhost_alias
##
## Enable mod_rewrite
##
RUN a2enmod rewrite
##
## Apache neu starten
##
RUN service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment