From 525c6a47a671e6aeb1c552927597a50718c50d87 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Fri, 27 Mar 2026 14:45:55 -0400 Subject: [PATCH] fix: dockerfile several changes including cloning repo instead of file copy fixed cron copy temporary production .env file add importmap and asset-map custom entrypoint --- Dockerfile | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index dccca0a..a7e75f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,14 +11,13 @@ RUN apt update && \ libjpeg-dev \ libicu-dev \ libpq-dev \ + libsqlite3-dev \ sqlite3 \ curl \ git \ cron \ nano -RUN service start cron -RUN service enable cron RUN docker-php-ext-configure gd --with-jpeg RUN docker-php-ext-configure zip @@ -42,26 +41,38 @@ 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 -RUN cd /var/www/html -RUN git clone https://gitea.rkprather.com/ryan/sermon-notes.git ./ +ARG CACHEBURST=1 +ARG BRANCH=master + +WORKDIR /var/www/html +RUN git clone -b ${BRANCH} --single-branch https://gitea.rkprather.com/ryan/sermon-notes.git ./ +RUN git config --global --add safe.directory /var/www/html RUN mv 000-default.conf /etc/apache2/sites-available/ -RUN echo "20 1 * * 6 root cd /var/www/html && /usr/local/bin/php bin/console app:get-audio > /var/log/sermon-notes.log 2>&1" > /etc/cron.d/get-audio +RUN echo "20 1 * * 6 root cd /var/www/html && /usr/local/bin/php bin/console app:get-audio > /proc/1/fd/1 2>&1" > /etc/cron.d/get-audio RUN chmod 644 /etc/cron.d/get-audio +RUN crontab /etc/cron.d/get-audio RUN COMPOSER_ALLOW_SUPERUSER=1 composer install --no-scripts --no-dev --optimize-autoloader -RUN /usr/local/bin/php bin/console asset-map:compile RUN mkdir /data -RUN mkdir /var/www/html/var/cache -RUN mkdir /var/www/html/var/log +RUN mkdir -p /var/www/html/var/cache +RUN mkdir -p /var/www/html/var/log RUN chown -R 33:33 /var/www/html /data RUN find /var/www/html -type d -exec chmod 755 '{}' \; RUN find /var/www/html -type f -exec chmod 644 '{}' \; RUN chmod 755 /data -RUN chmod 644 /data/* RUN a2enmod rewrite setenvif headers +COPY prod.env /var/www/html/.env +RUN /usr/local/bin/php bin/console importmap:install +RUN /usr/local/bin/php bin/console asset-map:compile +RUN rm /var/www/html/.env +RUN chmod +x /var/www/html/bin/entrypoint.sh + EXPOSE 80 + +ENTRYPOINT ["/var/www/html/bin/entrypoint.sh"] +CMD ["apache2-foreground"]