This commit is contained in:
William 2023-01-02 12:11:03 +00:00
parent 5eb769863d
commit d0db7231f0
6 changed files with 12 additions and 17 deletions

View File

@ -1,7 +1,6 @@
FROM alpine:latest FROM docker.io/alpine:latest
RUN apk update && \ RUN apk update && apk add nginx php-fpm
apk add nginx php81-fpm
RUN adduser -D -g 'www' www RUN adduser -D -g 'www' www

View File

@ -2,6 +2,8 @@
Made by yours truly Made by yours truly
# Docker install # Run with docker
docker build --no-cache -f ./Dockerfile --tag willy-club-website docker build --no-cache -f ./Dockerfile --tag willy-club-website
docker run -dt -p 8080:8080 --name willy-club-website willy-club-website

View File

@ -17,13 +17,9 @@ abstract class Route
)) return; )) return;
// check if the route matches and add parameters if any // check if the route matches and add parameters if any
$request_path = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['PHP_SELF']);
if ($request_path === '') {
$request_path = '/';
}
$args = []; $args = [];
$path_parts = explode('/', $path); $path_parts = explode('/', $path);
$request_path_parts = explode('/', $request_path); $request_path_parts = explode('/', strtok($_SERVER["REQUEST_URI"], '?'));
for ($i=0; $i < count($path_parts); $i++) { for ($i=0; $i < count($path_parts); $i++) {
if (empty($path_parts[$i])) { if (empty($path_parts[$i])) {
continue; continue;

View File

@ -34,4 +34,4 @@ http {
include fastcgi.conf; include fastcgi.conf;
} }
} }
} }

View File

@ -1,2 +1,4 @@
#!/bin/sh #!/bin/sh
nginx && php-fpm81 && tail -f /var/log/nginx/error.log nginx
php-fpm81
tail -f /var/log/nginx/error.log

View File

@ -7,11 +7,7 @@ body {
color: #111; color: #111;
font-size: 1rem; font-size: 1rem;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
line-height: 1.75; line-height: 1.5;
}
h1 {
margin-top: .5rem;
margin-bottom: .5rem;
} }
a { a {
color: blue; color: blue;