FROM wordpress:6.1.1-php8.2

ARG ENV_NAME

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
COPY composer.json composer.json
COPY composer.lock composer.lock
RUN composer install

COPY --chown=www-data:www-data ./htdocs/  /var/www/html/
COPY --chown=www-data:www-data ./environments/docker_container/ /var/www/html/
COPY --chown=www-data:www-data ./environments/all/ /var/www/html/
COPY --chown=www-data:www-data ./environments/${ENV_NAME}/robots.txt /var/www/html/robots.txt

