2024-07-17 18:13:39 +08:00
|
|
|
FROM php:8.3-apache
|
2019-06-23 19:16:45 +08:00
|
|
|
|
2024-03-12 21:04:33 +08:00
|
|
|
# Install additional dependencies
|
2024-10-29 23:06:50 +08:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y \
|
|
|
|
git \
|
|
|
|
zip \
|
|
|
|
unzip \
|
2024-12-02 00:02:21 +08:00
|
|
|
libfreetype-dev \
|
|
|
|
libjpeg62-turbo-dev \
|
2024-10-29 23:06:50 +08:00
|
|
|
libldap2-dev \
|
2024-12-02 00:02:21 +08:00
|
|
|
libpng-dev \
|
2024-10-29 23:06:50 +08:00
|
|
|
libzip-dev \
|
|
|
|
wait-for-it && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2024-03-12 21:04:33 +08:00
|
|
|
|
2024-10-29 23:06:50 +08:00
|
|
|
# Install PHP extensions
|
|
|
|
RUN docker-php-ext-configure ldap --with-libdir="lib/$(gcc -dumpmachine)" && \
|
2024-12-02 00:02:21 +08:00
|
|
|
docker-php-ext-configure gd --with-freetype --with-jpeg && \
|
|
|
|
docker-php-ext-install -j$(nproc) pdo_mysql gd ldap zip && \
|
2024-10-29 23:06:50 +08:00
|
|
|
pecl install xdebug && \
|
|
|
|
docker-php-ext-enable xdebug
|
2021-03-22 01:42:10 +08:00
|
|
|
|
|
|
|
# Install composer
|
2024-10-29 23:06:50 +08:00
|
|
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
|
|
|
|
|
|
|
# Configure apache
|
|
|
|
RUN 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
|
|
|
|
|
|
|
# Use the default production configuration and update it as required
|
2024-10-29 23:06:50 +08:00
|
|
|
RUN 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"
|
|
|
|
|
2024-10-29 23:07:15 +08:00
|
|
|
ENV APACHE_DOCUMENT_ROOT="/app/public"
|
|
|
|
|
2024-10-29 23:06:50 +08:00
|
|
|
WORKDIR /app
|