Skip to content

Instantly share code, notes, and snippets.

@richardsonlima
Created February 18, 2019 20:56
Show Gist options
  • Save richardsonlima/c374eb9278f309d29c299830cad7799e to your computer and use it in GitHub Desktop.
Save richardsonlima/c374eb9278f309d29c299830cad7799e to your computer and use it in GitHub Desktop.
web:
image: nginx:latest
ports:
- "8080:80"
volumes:
- ./code:/code
- ./site.conf:/etc/nginx/conf.d/site.conf
links:
- php
php:
image: php:7-fpm
<?php
echo phpinfo();
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 /code;
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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment