# 1. Use the official PHP image bundled with the Apache web server
FROM php:8.2-apache

# 2. Install the MySQL Data Objects (PDO) extensions required for your DB queries
RUN docker-php-ext-install pdo pdo_mysql

# 3. Enable Apache's mod_rewrite engine so your .htaccess file handles the API routing rules
RUN a2enmod rewrite

# 4. Copy all your backend files from GitHub straight into the web server's public root
COPY . /var/www/html/

# 5. Expose port 80 so Render can route incoming mobile app traffic to Apache
EXPOSE 80
