From 0c373aacd805ccefbee8944dade7e1d1a0c3c034 Mon Sep 17 00:00:00 2001 From: adb Date: Fri, 23 Oct 2020 16:03:29 +0000 Subject: [PATCH] install php_modules --- .gitignore | 1 + default.conf | 17 +++++++++++++++++ docker-compose.yml | 2 +- dockerfile | 2 ++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 default.conf create mode 100644 dockerfile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..567b905 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +./public/ diff --git a/default.conf b/default.conf new file mode 100644 index 0000000..0c52988 --- /dev/null +++ b/default.conf @@ -0,0 +1,17 @@ +server { + index index.php index.html; + server_name php-docker.local; + error_log /var/log/nginx/error.log; + access_log /var/log/nginx/access.log; + root /usr/share/nginx/html; + + location ~ \.php$ { + try_files $uri =404; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass php:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + } +} diff --git a/docker-compose.yml b/docker-compose.yml index 4ce95ab..e7cee36 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ web: - NGINX_HOST=0.0.0.0 - NGINX_PORT=80 php: - image: php:7-fpm-alpine + build: ./php/ volumes: - ./public:/usr/share/nginx/html restart: always diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..d274fbb --- /dev/null +++ b/dockerfile @@ -0,0 +1,2 @@ +FROM php:7-fpm-alpine +RUN docker-php-ext-install mysqli