From 6e9794fb8c6457010e8af0f4c2674845644b7a9e Mon Sep 17 00:00:00 2001 From: Lewin Probst Date: Tue, 22 Dec 2020 18:42:24 +0100 Subject: [PATCH] Added docker configuration. --- Docker/docker-compose.yml | 26 ++++++++++++++++++++++++++ Docker/nginx/localhost.conf | 29 +++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 Docker/docker-compose.yml create mode 100644 Docker/nginx/localhost.conf diff --git a/Docker/docker-compose.yml b/Docker/docker-compose.yml new file mode 100644 index 0000000..430f544 --- /dev/null +++ b/Docker/docker-compose.yml @@ -0,0 +1,26 @@ +version: "3.7" + +services: + web: + image: nginx:latest + container_name: lewp_nginx + depends_on: + - php + volumes: + - ./nginx:/etc/nginx/conf.d/ + - ./../:/var/www/html + ports: + - 8080:80 + + php: + image: php:8-fpm + container_name: lewp_php + volumes: + - ./../:/var/www/html + + composer: + image: composer:2.0.8 + container_name: lewp_composer + volumes: + - ./../:/app + command: composer install --ignore-platform-reqs diff --git a/Docker/nginx/localhost.conf b/Docker/nginx/localhost.conf new file mode 100644 index 0000000..5e30ca1 --- /dev/null +++ b/Docker/nginx/localhost.conf @@ -0,0 +1,29 @@ +server { + server_name localhost; + + listen 80; + root /var/www/html/www/localhost/bin; + + access_log /var/log/nginx/localhost.access.log; + error_log /var/log/nginx/localhost.error.log; + + rewrite ^.*$ /index.php; + + location ~ \.php$ { + include fastcgi_params; + fastcgi_param REQUEST_URI $request_uri; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + + fastcgi_pass lewp_php:9000; + } + + + gzip on; + gzip_comp_level 2; + gzip_http_version 1.0; + gzip_proxied any; + gzip_min_length 1100; + gzip_buffers 16 8k; + gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; +}