From f8250c9bbeb330793e79e0cbcb5d02ff31d05055 Mon Sep 17 00:00:00 2001 From: Aurelien Labate Date: Sat, 28 Dec 2019 21:41:13 +0100 Subject: [PATCH] Add FestivAlgo --- .gitmodules | 9 ++++++--- docker-compose.yml | 38 +++++++++++++++++++++++++++++++++++++- nginx.conf | 15 ++++++++++++--- php-docker/Dockerfile | 7 ++++++- src/FestivAlgo | 1 + 5 files changed, 62 insertions(+), 8 deletions(-) create mode 160000 src/FestivAlgo diff --git a/.gitmodules b/.gitmodules index b8894e2..572e555 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,12 @@ [submodule "src/SH4compatibilityTool"] path = src/SH4compatibilityTool - url = gitea@gitea.planet-casio.com:Ziqumu/SH4compatibilityTool.git + url = /Ziqumu/SH4compatibilityTool.git [submodule "src/G1rFxiTools"] path = src/G1rFxiTools - url = gitea@gitea.planet-casio.com:Ziqumu/G1rFxiTools.git + url = /Ziqumu/G1rFxiTools.git [submodule "src/EactMaker"] path = src/EactMaker - url = gitea@gitea.planet-casio.com:Ziqumu/EactMaker.git + url = /Ziqumu/EactMaker.git +[submodule "src/FestivAlgo"] + path = src/FestivAlgo + url = /Ziqumu/FestivAlgo.git diff --git a/docker-compose.yml b/docker-compose.yml index bf969dd..4dd4328 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,7 @@ services: - ./src/EactMaker:/www/EactMaker/ - ./src/SH4compatibilityTool:/www/SH4compatibilityTool/ - ./src/G1rFxiTools:/www/G1rFxiTools/ + - ./src/FestivAlgo:/www/FestivAlgo/ - ./src/home:/www/home/ phpfpm-main: @@ -26,5 +27,40 @@ services: - ./src/G1rFxiTools:/www/G1rFxiTools/ - ./src/home:/www/home/ + phpfpm-festivalgo: + build: + context: ./php-docker/ + args: + PHP_VERSION: 7.4 + networks: + - php-fpm + # - mariadb-festivalgo + volumes: + - ./src/FestivAlgo:/www/FestivAlgo/ + + # mariadb-festivalgo: + # image: mariadb + # networks: + # - mariadb-festivalgo + # environment: + # MYSQL_ROOT_PASSWORD: example2 + # MYSQL_USER: festivalgo + # MYSQL_PASSWORD: example + # MYSQL_DATABASE: festivalgo + # volumes: + # - ./src/FestivAlgo/database.sql:/docker-entrypoint-initdb.d/database.sql + # - ./volumes/mariadb-festivalgo:/var/lib/mysql + + # phpmyadmin-festivalgo: + # image: phpmyadmin/phpmyadmin:5 + # networks: + # - mariadb-festivalgo + # ports: + # - 8081:80 + # environment: + # PMA_HOST: mariadb-festivalgo + + networks: - php-fpm: \ No newline at end of file + php-fpm: + # mariadb-festivalgo: \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 7ff534a..9d7461d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -8,6 +8,7 @@ server { rewrite ^/fxi2g1r/(.*)$ $scheme://$http_host/G1rFxiTools/FXItoG1R/$1 permanent; rewrite ^/G1MtoG1R/(.*)$ $scheme://$http_host/G1rFxiTools/G1MtoG1R/$1 permanent; rewrite ^/PicViewer/(.*)$ $scheme://$http_host/G1rFxiTools/PicViewer/$1 permanent; + rewrite ^/festivalgo/(.*)$ $scheme://$http_host/FestivAlgo/$1 permanent; # Tools homepage rewrite ^(/_system/.*)$ /home/$1; @@ -24,11 +25,19 @@ server { fastcgi_param PATH_INFO $fastcgi_path_info; } + # Forward to the festivalgo php-fpm container + location ~ ^/FestivAlgo/.*\.php$ { + try_files $uri =404; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass phpfpm-festivalgo:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + } + # If we still have php there, that's an error! location ~ \.php$ { return 500; } } - - -# TODO add gd to php \ No newline at end of file diff --git a/php-docker/Dockerfile b/php-docker/Dockerfile index 2170ce7..e71b5d7 100644 --- a/php-docker/Dockerfile +++ b/php-docker/Dockerfile @@ -1,8 +1,13 @@ ARG PHP_VERSION FROM php:${PHP_VERSION}-fpm + +# Install GD extension RUN apt-get update && apt-get install -y \ libfreetype6-dev \ libjpeg62-turbo-dev \ libpng-dev \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) gd \ No newline at end of file + && docker-php-ext-install -j$(nproc) gd + +# Install PDO mysql extension +RUN docker-php-ext-install pdo pdo_mysql \ No newline at end of file diff --git a/src/FestivAlgo b/src/FestivAlgo new file mode 160000 index 0000000..b640a41 --- /dev/null +++ b/src/FestivAlgo @@ -0,0 +1 @@ +Subproject commit b640a41bfeacb86fff81fce5aebf5d07c5a18d58