# Base image
FROM composer:2.6.4 AS base

COPY . /src
WORKDIR /src
RUN composer install --no-dev --optimize-autoloader

FROM wordpress:6.1.1-php8.2 AS livecarta_wp
ARG ENV_NAME
COPY --from=base /src/htdocs /var/www/html
COPY --from=base /src/environments/docker_container/ /var/www/html/
COPY --from=base /src/environments/all/ /var/www/html/
COPY --from=base /src/environments/${ENV_NAME}/robots.txt /var/www/html/robots.txt

RUN chown -R www-data:www-data /var/www/html/
