From 15111e3e1ae5ec7ed8f4cb7870ea0c71a8d6024d Mon Sep 17 00:00:00 2001 From: marko Date: Sun, 30 Jun 2024 09:01:58 +0200 Subject: [PATCH] nginx, php in docker --- .../cwsvJudo/participo/app/public/index.html | 1 + .../cwsvJudo/participo/app/public/index.php | 2 ++ .../cwsvJudo/participo/docker-compose.yml | 19 +++++++++++++++++++ homepage/cwsvJudo/participo/nginx.conf | 12 ++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 homepage/cwsvJudo/participo/app/public/index.html create mode 100644 homepage/cwsvJudo/participo/app/public/index.php create mode 100644 homepage/cwsvJudo/participo/docker-compose.yml create mode 100644 homepage/cwsvJudo/participo/nginx.conf diff --git a/homepage/cwsvJudo/participo/app/public/index.html b/homepage/cwsvJudo/participo/app/public/index.html new file mode 100644 index 0000000..f76d8e9 --- /dev/null +++ b/homepage/cwsvJudo/participo/app/public/index.html @@ -0,0 +1 @@ +

Hello, World!

diff --git a/homepage/cwsvJudo/participo/app/public/index.php b/homepage/cwsvJudo/participo/app/public/index.php new file mode 100644 index 0000000..b866157 --- /dev/null +++ b/homepage/cwsvJudo/participo/app/public/index.php @@ -0,0 +1,2 @@ +} label is a self defined name for the service +services: + # the web service + web: + image: nginx:latest + # port forwarding + ports: + # forward port 80 top port 80 in the container + - "80:80" + # files and directories to be available in the container + volumes: + - ./nginx.conf:/etc/nginx/conf.d/nginx.conf + - ./app:/app + php: + image: php:fpm + volumes: + - ./app:/app diff --git a/homepage/cwsvJudo/participo/nginx.conf b/homepage/cwsvJudo/participo/nginx.conf new file mode 100644 index 0000000..1e41db9 --- /dev/null +++ b/homepage/cwsvJudo/participo/nginx.conf @@ -0,0 +1,12 @@ +server { + listen 80 default_server; + root /app/public; + + index index.php index.html index.htm; + + location ~ \.php$ { + fastcgi_pass php:9000; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } +}