From 194c5e43b79c3dc95f048c7859ab4ad952558d39 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Sat, 14 Oct 2023 23:53:54 +0500 Subject: [PATCH] clean --- Dockerfile | 10 ++++++++++ README.md | 4 ++++ docker-compose.yml | 18 ++++++++++++++++++ nginx.conf | 24 ++++++++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 docker-compose.yml create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..45fbd56 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM nginx + +# Install basic tools +RUN apt update \ + && apt install curl nano iputils-ping zip unzip -y --no-install-recommends \ + && apt auto-remove -y \ + && apt clean -y + +COPY nginx.conf /etc/nginx/conf.d/default.conf +WORKDIR /etc/nginx diff --git a/README.md b/README.md new file mode 100644 index 0000000..1bdc4ad --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# NGINX-FPM +Bacically base nginx image with support for fpm +This container is meant to be used with php-containers! + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f2521c3 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: '3.5' +services: +######################### + nginx: + build: + context: . + dockerfile: Dockerfile + x-bake: + pull: true + platforms: + - linux/amd64/v1 + - linux/amd64/v2 + - linux/amd64/v3 + - linux/arm/v7 + - linux/arm64 + hostname: nginx + platform: linux/amd64/v3 + image: git.shihaam.dev/dockerfiles/nginx-fpm:latest diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..c99fcc0 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,24 @@ +server { + listen 80; + + server_name _; + access_log /dev/stdout; + error_log /dev/stdout info; + + root /var/www/html/public; + index index.php; + + client_max_body_size 5M; + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + + location ~ [^/]\.php(/|$) { + fastcgi_pass fpm:9000; + include fastcgi_params; + #fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_param SCRIPT_FILENAME $request_filename; + } +} +