ldc-web-images-docker/PHP8.2/DEV/Dockerfile

66 lines
No EOL
2.8 KiB
Docker

FROM php:8.2-apache-bullseye
ENV DEBIAN_FRONTEND=noninteractive \
LC_ALL=fr_FR.UTF-8 \
LANG=fr_FR.UTF-8 \
LANGUAGE=fr_FR.UTF-8:fr
# --- Install System & Dev Packages, Configure Locale and Node.js ---
RUN apt-get update -qq && apt-get install -qy \
nano vim git zsh htop \
libfreetype6-dev libjpeg62-turbo-dev libpng-dev libwebp-dev libxpm-dev \
zlib1g-dev libicu-dev g++ \
libxslt-dev libzip-dev unzip zip \
libmagick++-dev libmagickwand-dev \
libmemcached-dev \
ldap-utils libldap2-dev \
locales \
ca-certificates curl gnupg mariadb-client \
&& echo "fr_FR.UTF-8 UTF-8" > /etc/locale.gen \
&& locale-gen fr_FR.UTF-8 \
&& dpkg-reconfigure locales \
&& /usr/sbin/update-locale LANG=fr_FR.UTF-8 \
# NodeSource Node.js repo for Node 18.x
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | \
gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" \
> /etc/apt/sources.list.d/nodesource.list \
&& apt-get update -qq && apt-get install -y nodejs \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# --- PHP Extension Configuration and Build ---
RUN docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype \
&& docker-php-ext-configure intl \
&& docker-php-ext-configure zip --with-zip \
&& docker-php-ext-configure ldap \
&& docker-php-ext-install exif gd gettext intl mysqli pdo_mysql xsl opcache zip bcmath ldap
# --- PECL Extensions ---
RUN pecl install imagick-3.6.0 memcached-3.2.0 redis-6.0.2 xdebug pcov \
&& docker-php-ext-enable imagick memcached redis pcov
# --- Composer (specific version) ---
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --version=2.5.5
# --- Oh-My-Zsh and Plugins ---
RUN sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" "" --unattended \
&& git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions \
&& sed -i 's/plugins=(git)/plugins=(git laravel zsh-autosuggestions)/g' ~/.zshrc
ENV SHELL=/bin/zsh
# Set default shell to zsh
RUN chsh -s /bin/zsh
# --- Apache configuration ---
COPY conf/common-apache.conf /etc/apache2/conf-available/z-app.conf
COPY conf/common-ports.conf /etc/apache2/ports.conf
COPY conf/common-security.conf /etc/apache2/conf-enabled/security.conf
COPY conf/php.ini /usr/local/etc/php/conf.d/app.ini
COPY conf/vhost.conf /etc/apache2/sites-available/000-default.conf
RUN a2enmod rewrite remoteip headers http2 && \
a2enconf z-app
WORKDIR /app/srcs