# Use the official WordPress image with PHP 8.2
FROM wordpress:php8.2

# Install the MySQL client
RUN apt-get update
RUN apt-get install -y default-mysql-client
RUN apt-get install -y git
RUN apt-get install -y curl wget gnupg
RUN rm -rf /var/lib/apt/lists/*

RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
    && chmod +x wp-cli.phar \
    && mv wp-cli.phar /usr/local/bin/wp

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get install -y nodejs

WORKDIR /var/www/html

EXPOSE 80

# Command to run Apache (provided by the parent image)
CMD ["apache2-foreground"]