# Use official PHP with Apache
FROM php:8.2-apache

# Enable Apache rewrite (optional, useful for .htaccess)
RUN a2enmod rewrite

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

# Set working directory
WORKDIR /var/www/html

# Set permissions (safe defaults)
RUN chown -R www-data:www-data /var/www/html \
    && chmod -R 755 /var/www/html

# Expose port 80
EXPOSE 80