Created
August 29, 2016 06:57
-
-
Save kovagoz/d3903c069b67372ac6b0e9b78e86161e to your computer and use it in GitHub Desktop.
Laravel Docker Compose Nginx PHP-FPM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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