added php support
This commit is contained in:
@@ -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
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user