Skip to content

Instantly share code, notes, and snippets.

@kovagoz
Created August 29, 2016 06:57
Show Gist options
  • Save kovagoz/d3903c069b67372ac6b0e9b78e86161e to your computer and use it in GitHub Desktop.
Save kovagoz/d3903c069b67372ac6b0e9b78e86161e to your computer and use it in GitHub Desktop.
Laravel Docker Compose Nginx PHP-FPM
version: '2'
services:
nginx:
image: nginx:alpine
ports:
- "8000:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
links:
- fpm
fpm:
image: php:7-fpm-alpine
volumes:
- ./blog:/laravel
expose:
- 9000
user nginx;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
sendfile off;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
client_max_body_size 100M;
server {
listen 80 default_server;
server_name _;
root /var/www;
index index.php;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass fpm:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /laravel/public/index.php;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment