FROM php:8.3-apache

# Enable mod_rewrite for clean URLs
RUN a2enmod rewrite

# Install PHP extensions
RUN docker-php-ext-install pdo_mysql

# Copy Apache vhost config
COPY docker/apache.conf /etc/apache2/sites-available/000-default.conf

# Copy all project files into the container
COPY . /var/www/html

# Fix permissions
RUN chown -R www-data:www-data /var/www/html

WORKDIR /var/www/html