Browse Source

Upgraded to PHP 8, updated docker, docker-compose files

master
jrtechs 2 days ago
parent
commit
a38192d89c
7 changed files with 36 additions and 25 deletions
  1. +2
    -3
      Dockerfile
  2. +13
    -9
      docker-compose.yml
  3. +2
    -3
      games/bamboofield.html
  4. +4
    -2
      games/zombiePanda.html
  5. +12
    -3
      includes/header.php
  6. +2
    -3
      php_docker/Dockerfile
  7. +1
    -2
      site.conf

+ 2
- 3
Dockerfile View File

@ -1,4 +1,4 @@
FROM nginx:1.17.8-alpine
FROM nginx:1.29-alpine
# Copy the public directory
COPY . /app/public/
@ -6,5 +6,4 @@ COPY . /app/public/
# Copy the nginx config file
COPY ./site.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
EXPOSE 8080
EXPOSE 80

+ 13
- 9
docker-compose.yml View File

@ -1,20 +1,24 @@
version: '3'
# Php-fpm configuration
php:
services:
php-panda:
build: ./php_docker/
volumes:
- .:/app/public
links:
- clubdb
networks:
- panda-net
web:
web-panda:
build: .
ports:
- "8080:80"
- "5000:80"
volumes:
- .:/app/public
links:
- php
depends_on:
- php
- php-panda
networks:
- panda-net
networks:
panda-net:
driver: bridge

+ 2
- 3
games/bamboofield.html View File

@ -243,9 +243,8 @@ function playBF()
'action="insertScore.php" method="post"><input ' +
'type="hidden" name="game_new_score" value=true>' +
'<input type="hidden" name="game" value=1><input ' +
'type="hidden" name="user_id_score" ' +
'value=<?php echo $_SESSION['user_id']; ?>><input ' +
'type="hidden" name="score_validate" value=' + score + '></form>';
'type="hidden" name="user_id_score" value=<?php echo isset($_SESSION["user_id"]) ? (int)$_SESSION["user_id"] : 0; ?>><input ' +
'type="hidden" name="score_validate" value=' + score + '></form>';
document.getElementById("dynForm").submit();
sent = true;

+ 4
- 2
games/zombiePanda.html View File

@ -144,6 +144,8 @@ function playZP()
return Math.floor(Math.random() * (max - min + 1)) + min;
}
var zombieBaseSpeed = 1;
//zombie
var Zombie = function(x,y)
{
@ -151,7 +153,7 @@ function playZP()
this.y = y;
this.width = 25;
this.height = 25;
this.speed = 3;
this.speed = zombieBaseSpeed;
var side = getRandomIntInclusive(0,3);
var mid = getRandomIntInclusive(0,700);
@ -348,7 +350,7 @@ function playZP()
'<input type="hidden" name="game_new_score" ' +
'value=true><input type="hidden" name="game" value=2>' +
'<input type="hidden" name="user_id_score" value=' +
'<?php echo $_SESSION['user_id']; ?>><input ' +
'<?php echo isset($_SESSION["user_id"]) ? (int)$_SESSION["user_id"] : 0; ?>><input ' +
'type="hidden" name="score_validate" value=' + score + '>' +
'</form>';
document.getElementById("dynForm").submit();

+ 12
- 3
includes/header.php View File

@ -6,8 +6,16 @@ $admin = false;
session_start();
ob_start();
echo getcwd();
echo "$dir";
// Determine directory depth by checking if club_connect.php exists in current or parent directory
if(file_exists("./club_connect.php"))
{
$dir = 1;
}
else
{
$dir = 2;
}
if($dir == 2)
{
require_once("../club_connect.php");
@ -20,7 +28,8 @@ else
}
if((md5($_SERVER['HTTP_USERAGENT'] . 'salt')) == ($_SESSION['agent']) &&
if(isset($_SERVER['HTTP_USERAGENT']) && isset($_SESSION['agent']) && isset($_SESSION['use']) &&
md5($_SERVER['HTTP_USERAGENT'] . 'salt') == $_SESSION['agent'] &&
$_SESSION['use'] == true)
{
$loggedIn = true;

+ 2
- 3
php_docker/Dockerfile View File

@ -1,9 +1,8 @@
FROM php:7.4.3-fpm-alpine3.11
FROM php:8.1-fpm-alpine
RUN apk update \
&& apk add sqlite \
&& apk add socat \
&& apk add php-sqlite3
&& apk add socat
# Copy the php config file
COPY ./php-fpm.conf /usr/local/etc/php-fpm.d/www.conf

+ 1
- 2
site.conf View File

@ -13,9 +13,8 @@ server {
location ~ \.php$ {
resolver 127.0.0.11;
set $upstream php:9000;
include fastcgi_params;
fastcgi_pass $upstream;
fastcgi_pass php-panda:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}

Loading…
Cancel
Save