From a1a702b386bd61c9044cb871f848c03a525304a0 Mon Sep 17 00:00:00 2001 From: HugoPoi Date: Sun, 1 May 2022 16:28:54 +0200 Subject: [PATCH] feat(dev-env): add a docker-compose and nginx sample config --- docker-compose.yml | 14 ++++++++++++++ nginx.conf | 16 ++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 docker-compose.yml create mode 100644 nginx.conf diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c610c34 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: "3" + +services: + web: + image: nginx:latest + ports: + - "8080:80" + volumes: + - ./www:/var/www/html + - ./nginx.conf:/etc/nginx/conf.d/default.conf + php-fpm: + image: php:8-fpm + volumes: + - ./www:/var/www/html diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..4a57c3b --- /dev/null +++ b/nginx.conf @@ -0,0 +1,16 @@ +server { + index index.php; + # server_name phpfpm.local; + # error_log /var/log/nginx/error.log; + # access_log /var/log/nginx/access.log; + root /var/www/html; + try_files $uri $uri/ /index.php; + location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass php-fpm:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + } +}