2022-02-04 21:26:39 +08:00
|
|
|
FROM php:8.1-apache
|
2019-06-23 19:16:45 +08:00
|
|
|
|
|
|
|
ENV APACHE_DOCUMENT_ROOT /app/public
|
|
|
|
WORKDIR /app
|
|
|
|
|
2024-03-12 21:04:33 +08:00
|
|
|
RUN <<EOR
|
|
|
|
# Install additional dependencies
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y \
|
|
|
|
git \
|
|
|
|
zip \
|
|
|
|
unzip \
|
|
|
|
libpng-dev \
|
|
|
|
libldap2-dev \
|
|
|
|
libzip-dev \
|
|
|
|
wait-for-it
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# Configure apache
|
|
|
|
docker-php-ext-configure ldap --with-libdir="lib/$(gcc -dumpmachine)"
|
|
|
|
docker-php-ext-install pdo_mysql gd ldap zip
|
|
|
|
pecl install xdebug
|
|
|
|
docker-php-ext-enable xdebug
|
|
|
|
a2enmod rewrite
|
|
|
|
sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
|
|
|
|
sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
|
2021-03-22 01:42:10 +08:00
|
|
|
|
|
|
|
# Install composer
|
2024-03-12 21:04:33 +08:00
|
|
|
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
2021-03-22 01:42:10 +08:00
|
|
|
|
|
|
|
# Use the default production configuration and update it as required
|
2024-03-12 21:04:33 +08:00
|
|
|
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
|
|
|
|
sed -i 's/memory_limit = 128M/memory_limit = 512M/g' "$PHP_INI_DIR/php.ini"
|
|
|
|
EOR
|