diff --git a/README.md b/README.md index ec3e97b..2cceecd 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,31 @@ Your project MUST contain an `index.php` file at the root of your project. Nothing else is required. Application → https://php.is-easy-on-scalingo.com/ + +# Sample Application with PHP + +This sample is running on: https://php.is-easy-on-scalingo.com/ + +## Deploy via Git + +Create an application on https://scalingo.com, then: + +```shell +scalingo --app my-app git-setup +git push scalingo master +``` + +And that's it! + +## Deploy via One-Click + +[![Deploy to Scalingo](https://cdn.scalingo.com/deploy/button.svg)](https://dashboard.scalingo.com/create/app?source=https://github.com/Scalingo/sample-php#master) + +## Running Locally + +```shell +docker compose up +``` + +The app listens by default on the port 8080 or the one defined in the `PORT` +environment variable. \ No newline at end of file diff --git a/config/nginx.conf b/config/nginx.conf new file mode 100644 index 0000000..ffa0f53 --- /dev/null +++ b/config/nginx.conf @@ -0,0 +1,13 @@ +server { + listen 80; + server_name localhost; + root /app; + index index.php; + + location ~ \.php$ { + fastcgi_pass php:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..546b1ac --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +services: + + web: + image: nginx:latest + ports: + - "${PORT:-8080}:80" + volumes: + - ./config/nginx.conf:/etc/nginx/conf.d/default.conf + - .:/app + + php: + image: php:8.1-fpm + volumes: + - .:/app + +volumes: + app: