# Use an official PHP runtime as a parent image
FROM php:7.4-apache

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

# Copy the current directory contents into the container at /var/www/html
COPY . /var/www/html

# Use the default production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

# Install any needed extensions. Here, we're installing the MySQLi and sockets extensions
RUN docker-php-ext-install mysqli sockets && docker-php-ext-enable mysqli sockets

# Make port 80 available to the world outside this container
EXPOSE 80

# Run Apache in the foreground
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
