# Use a PHP base image
FROM php:8.0-apache

# Set the working directory
WORKDIR /var/www/html

# Copy the PHP files to the container
COPY . /var/www/html/


# Copy the .htaccess file to enable directory index
#COPY .htaccess /var/www/html/


# Install pdo_mysql extension
RUN docker-php-ext-install pdo_mysql

# Set the timezone if needed
RUN ln -snf /usr/share/zoneinfo/Africa/Lagos /etc/localtime && echo "Africa/Lagos" > /etc/timezone

# Enable required Apache modules if needed
RUN a2enmod rewrite

# Expose the Apache port
EXPOSE 80
