From 46575b08f7764d8f299fe78467c74e3b9ac5bfd0 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Fri, 28 Feb 2025 13:21:50 +0000 Subject: [PATCH] build(docker): update Dockerfile for better setup order (#39) Reviewed-on: https://git.simonis.lol/projects/abiball/pulls/39 Co-authored-by: Jan Klattenhoff Co-committed-by: Jan Klattenhoff --- .docker/Dockerfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index f6fcadd..649ba3a 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,11 +1,6 @@ FROM composer AS composer FROM php:apache -COPY .. /var/www/html/ -COPY --from=composer /usr/bin/composer /usr/bin/composer -COPY .docker/hosts/abiball.conf /etc/apache2/sites-enabled - -RUN chown -R www-data:www-data /var/www/html RUN rm /etc/apache2/sites-enabled/000-default.conf RUN apt-get update @@ -17,7 +12,14 @@ RUN a2enmod rewrite RUN pecl install apcu && docker-php-ext-enable apcu WORKDIR /var/www/html + +COPY .. /var/www/html/ +COPY --from=composer /usr/bin/composer /usr/bin/composer +COPY .docker/hosts/abiball.conf /etc/apache2/sites-enabled + +RUN chown -R www-data:www-data /var/www/html + RUN composer install --optimize-autoloader --no-suggest --no-progress RUN php bin/console tailwind:build RUN php bin/console asset-map:compile -RUN echo "APP_ENV=prod" > .env.local \ No newline at end of file +RUN echo "APP_ENV=prod" > .env.local