Update Dockerfile to install PHP extensions and configure

This commit is contained in:
Philip
2026-01-26 18:57:40 -08:00
committed by GitHub
parent e045354892
commit 70238f2758
+18 -1
View File
@@ -1 +1,18 @@

FROM php:8.2-apache
# Install necessary PHP extensions for MySQL and Image handling
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd pdo_mysql
# Enable Apache mod_rewrite (useful for many PHP apps)
RUN a2enmod rewrite
# Copy your source code into the container
COPY . /var/www/html/
# Set permissions
RUN chown -R www-data:www-data /var/www/html