Rework dockerfile to final form

This commit is contained in:
Ryan Prather 2024-05-24 00:54:38 -04:00
parent a624faa728
commit d943cbc5ec

View File

@ -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