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
This commit is contained in:
29
Dockerfile
29
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"]
|
||||
|
||||
Reference in New Issue
Block a user