From 4a8171881856d610af91bd9fc1185ba540d656a9 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Fri, 24 May 2024 00:54:38 -0400 Subject: [PATCH] Rework dockerfile to final form --- Dockerfile | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 11a8795..6be4c33 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM php:8.2-apache -WORKDIR /var/www/html - RUN apt update && \ apt upgrade -y && \ apt install -y \ @@ -37,16 +35,20 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && RUN curl -sS https://get.symfony.com/cli/installer | bash && \ mv /root/.symfony5/bin/symfony /usr/local/bin/symfony -COPY 000-default.conf /etc/apache2/sites-available/ - -COPY composer.lock composer.json /var/www/html/ - -RUN composer install --no-scripts --no-dev --optimize-autoloader - COPY . /var/www/html/ -RUN rm /var/www/html/.env* -RUN cp /var/www/html/data/data.db /var/www/html/var/ +RUN mv 000-default.conf /etc/apache2/sites-available/ +RUN rm /var/www/html/.env* +RUN rm -rf /var/www/html/var/* +RUN rm -rf /var/www/html/vendor +RUN rm -rf /var/www/html/tests +RUN rm -rf /var/www/html/translations + +RUN COMPOSER_ALLOW_SUPERUSER=1 composer install --no-scripts --no-dev --optimize-autoloader +RUN mv /var/www/html/data/data.db /var/www/html/var/ + +RUN mkdir /var/www/html/var/cache +RUN mkdir /var/www/html/var/log RUN chown -R www-data:www-data /var/www/html RUN chmod -R 755 /var/www/html \ No newline at end of file