From 995c5fa94bb225450418ef2a7a88600bae615645 Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 19 Aug 2021 14:46:33 +0900 Subject: [PATCH] php8 (#1) Reviewed-on: https://storage.hided.net/gitea/devsam/docker/pulls/1 Co-authored-by: hide_d Co-committed-by: hide_d --- hidche/app/Dockerfile | 6 ++++-- hidche/app/entrypoint.sh | 2 +- hidche/app/sam_conf.ini | 2 ++ hidche/board/Dockerfile | 3 ++- hidche/web/rhymix.conf | 5 +++++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/hidche/app/Dockerfile b/hidche/app/Dockerfile index 0a6b79f..6acf35e 100644 --- a/hidche/app/Dockerfile +++ b/hidche/app/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.4-fpm-buster +FROM php:8.0-fpm-buster #debian ENV LC_ALL=C.UTF-8 @@ -30,7 +30,6 @@ RUN mkdir -p /var/www/html/; \ COPY entrypoint.sh /usr/local/bin/ COPY id_ecdsa known_hosts /var/www/.ssh/ -COPY sam_conf.ini /usr/local/etc/php/conf.d/sam_conf.ini VOLUME /var/www/html ARG UID=33 @@ -44,6 +43,7 @@ RUN if [ "$UID" != 33 ]; then \ fi; \ echo $UID > /var/tmp.txt ; \ chmod +x /usr/local/bin/entrypoint.sh; \ + mkdir -p /var/www/opcache; \ chown -R www-data:www-data /var/www; \ chmod -R g=u /var/www; \ mkdir -p /var/www/.ssh; \ @@ -51,5 +51,7 @@ RUN if [ "$UID" != 33 ]; then \ chmod 700 /var/www/.ssh; \ chmod 600 /var/www/.ssh/*; +COPY sam_conf.ini /usr/local/etc/php/conf.d/sam_conf.ini + ENTRYPOINT ["entrypoint.sh"] CMD ["php-fpm"] \ No newline at end of file diff --git a/hidche/app/entrypoint.sh b/hidche/app/entrypoint.sh index 07b5ac8..0d7f903 100755 --- a/hidche/app/entrypoint.sh +++ b/hidche/app/entrypoint.sh @@ -14,7 +14,7 @@ if [ ! -f "$samRoot/index.php" ]; then gosu www-data git clone $gameGitPath $samRoot fi -if [ $HIDCHE_IMAGE_USE_INTERNAL = "yes" ] && [ ! -d "$imageRoot" ]; then +if [ "$HIDCHE_IMAGE_USE_INTERNAL" = "yes" ] && [ ! -d "$imageRoot" ]; then if [[ "$imgGitPath" =~ ^ssh ]]; then query=`echo "> /var/www/.ssh/known_hosts 2>/dev/null; diff --git a/hidche/app/sam_conf.ini b/hidche/app/sam_conf.ini index f396947..8a47e36 100644 --- a/hidche/app/sam_conf.ini +++ b/hidche/app/sam_conf.ini @@ -7,9 +7,11 @@ memory_limit=512M apc.enable_cli=1 opcache.enable=1 +opcache.jit_buffer_size=100M opcache.interned_strings_buffer=8 opcache.max_accelerated_files=10000 opcache.validate_timestamps=on opcache.memory_consumption=128 opcache.save_comments=1 opcache.revalidate_freq=1 +opcache.file_cache="/var/www/opcache" diff --git a/hidche/board/Dockerfile b/hidche/board/Dockerfile index 9452a2b..ec58178 100644 --- a/hidche/board/Dockerfile +++ b/hidche/board/Dockerfile @@ -41,7 +41,6 @@ RUN { \ mkdir -p /var/www/.ssh; COPY entrypoint.sh /usr/local/bin/ -COPY sam_conf.ini /usr/local/etc/php/conf.d/sam_conf.ini VOLUME /var/www/board @@ -60,5 +59,7 @@ RUN if [ "$UID" != 33 ]; then \ mkdir -p /var/www/.ssh; \ chown www-data:www-data /var/www/.ssh; +COPY sam_conf.ini /usr/local/etc/php/conf.d/sam_conf.ini + ENTRYPOINT ["entrypoint.sh"] CMD ["php-fpm"] \ No newline at end of file diff --git a/hidche/web/rhymix.conf b/hidche/web/rhymix.conf index 245608d..fe2c105 100644 --- a/hidche/web/rhymix.conf +++ b/hidche/web/rhymix.conf @@ -25,6 +25,11 @@ location ~ ^/board/(.+)\.min\.(css|js)$ { try_files $uri $uri/ /board/$1.$2; } +# fix download URL when other directives for static files are present +location ~ ^/board/files/download/ { + try_files $uri $uri/ /board/index.php$is_args$args; +} + # all other short URLs location /board/ { try_files $uri $uri/ /board/index.php$is_args$args;