From 91f82dbb9608e4dd8861c173401a3e19615dd980 Mon Sep 17 00:00:00 2001 From: Angel Garcia <32900272+a-garcia-alvarez@users.noreply.github.com> Date: Fri, 7 Oct 2022 18:13:30 +0200 Subject: [PATCH] Merged upstream 'zunjae/master' and adapted to local changes (#7) * Works again, sorry, been sleeping * Enable redis cache - Enabled redis cache - Changed some cache timings - Disabled GitHub Reporting * Moved all .env modifications to another layer Unsure if another layer is that bad But this improve .env changes rebuild times Co-authored-by: sunjay <9930542+zunjae@users.noreply.github.com> Co-authored-by: Angel Garcia --- jikan/Dockerfile | 44 ++++++++++++++++++++++---------------------- jikan/run-jikan.sh | 6 +----- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/jikan/Dockerfile b/jikan/Dockerfile index 5ff1307..1d90f5f 100755 --- a/jikan/Dockerfile +++ b/jikan/Dockerfile @@ -1,29 +1,29 @@ FROM php:7.4-apache -ENV COMPOSER_ALLOW_SUPERUSER 1 +ENV COMPOSER_ALLOW_SUPERUSER 1 -RUN apt-get update && apt-get install -y \ - curl \ - git \ - unzip \ - && apt-get clean && rm -rf /var/lib/apt/lists/* \ - && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ - && composer --version \ - && a2enmod rewrite \ - && service apache2 restart \ - && git clone https://github.com/jikan-me/jikan-rest.git -b v3 . \ - && git checkout v3 \ - && cp .env.dist .env \ - && sed -i "s/GITHUB_REPORTING=.*/GITHUB_REPORTING=false/" .env \ - && sed -i "s/REDIS_HOST=.*/REDIS_HOST=jikan-redis/" .env \ - && sed -i "s/CACHE_DEFAULT_EXPIRE=.*/CACHE_DEFAULT_EXPIRE=3600/" .env \ - && sed -i "s/CACHE_404_EXPIRE=.*/CACHE_404_EXPIRE=3600/" .env \ - && sed -i "s/CACHE_SEARCH_EXPIRE=.*/CACHE_SEARCH_EXPIRE=3600/" .env \ - && composer config --no-plugins allow-plugins true \ - && composer install --prefer-dist --no-progress --classmap-authoritative --no-interaction \ - && composer update jikan-me/jikan +RUN apt-get update && apt-get install -y \ + openssl \ + git \ + unzip \ + && apt-get clean && rm -rf /var/lib/apt/lists/* \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ + && composer --version -ADD run-jikan.sh ./ +RUN git clone https://github.com/jikan-me/jikan-rest.git -b v3 . \ + && git checkout v3 \ + && cp .env.dist .env \ + && composer require 'composer/package-versions-deprecated' \ + && composer install --prefer-dist --no-progress --classmap-authoritative --no-interaction \ + && composer update jikan-me/jikan + +RUN sed -i "s/CACHE_DRIVER=.*/CACHE_DRIVER=redis/" .env \ + && sed -i "s/REDIS_HOST=.*/REDIS_HOST=jikan-redis/" .env \ + && sed -i "s/CACHE_404_EXPIRE=.*/CACHE_404_EXPIRE=3600/" .env \ + && sed -i "s/CACHE_SEARCH_EXPIRE=.*/CACHE_SEARCH_EXPIRE=1000/" .env \ + && sed -i "s/GITHUB_REPORTING=.*/GITHUB_REPORTING=false/" .env + +ADD /run-jikan.sh ./ ENTRYPOINT ["./run-jikan.sh"] diff --git a/jikan/run-jikan.sh b/jikan/run-jikan.sh index 1a3d891..ad914d4 100755 --- a/jikan/run-jikan.sh +++ b/jikan/run-jikan.sh @@ -1,7 +1,3 @@ #!/usr/bin/env bash -# allow write permission chmod -R a+w storage/ - -# php:7.3.14-apache-buster ENTRYPOINT -#docker-php-entrypoint apache2-foreground -php artisan serve --host 0.0.0.0 --port=8080 +php -S 0.0.0.0:8080 -t public \ No newline at end of file