From 725498a0d33357b0ae023654f3504621311abe76 Mon Sep 17 00:00:00 2001 From: gyurix Date: Mon, 1 Jul 2024 08:50:03 +0200 Subject: [PATCH] added php support --- Dockerfile | 6 +++++- nginx.conf | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5ce5a67..7abd02c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,11 @@ FROM alpine:latest ENV NGINX_VERSION=1.25.4 +ARG PHP_VERSION="8.2.20" RUN \ build_pkgs="build-base linux-headers openssl-dev pcre-dev wget zlib-dev" && \ - runtime_pkgs="ca-certificates openssl pcre zlib tzdata git" && \ + runtime_pkgs="ca-certificates openssl pcre zlib tzdata " && \ apk --no-cache add ${build_pkgs} ${runtime_pkgs} && \ cd /tmp && \ wget https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz && \ @@ -56,6 +57,9 @@ RUN \ apk del ${build_pkgs} && \ rm -rf /var/cache/apk/* +RUN apk --no-cache add php8=${PHP_VERSION} \ + php8-curl + COPY nginx.conf /etc/nginx/nginx.conf RUN mkdir -p /usr/share/nginx/html diff --git a/nginx.conf b/nginx.conf index f860c68..9ebcdf3 100644 --- a/nginx.conf +++ b/nginx.conf @@ -27,7 +27,12 @@ http { server_name localhost; location / { root /usr/share/nginx/html; - index index.html + index index.html; + } + location ~ \.php$ { + try_files $uri =404; + fastcgi_index index.php; + include fastcgi_params; } error_page 500 502 503 504 /50x.html;