Permalink
Browse files

Added default docker-compose setup for nginx+php-fpm

  • Loading branch information...
DracoBlue committed Apr 7, 2017
1 parent 63b2dfd commit c2de8852064cb5f2d1bc7881a3a516bdf331a586
Showing with 68 additions and 0 deletions.
  1. +43 −0 .docker/nginx.conf
  2. +25 −0 docker-compose.yml
View
@@ -0,0 +1,43 @@
server {
server_name dev.localtest.me;
listen 8080 default_server;
root /usr/src/app/web;
location / {
try_files $uri /app_dev.php$is_args$args;
}
location ~ ^/(app_dev|config)\.php(/|$) {
fastcgi_pass php-fpm:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
location ~ \.php$ {
return 404;
}
}
server {
server_name app.localtest.me;
listen 8080;
root /usr/src/app/web;
location / {
try_files $uri /app.php$is_args$args;
}
location ~ ^/(app|config)\.php(/|$) {
fastcgi_pass php-fpm:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
location ~ \.php$ {
return 404;
}
}
View
@@ -0,0 +1,25 @@
version: "2.1"
services:
php-cli:
image: exozet/php-fpm:7.1.2-sudo
user: www-data
entrypoint: bash
volumes:
- ./:/usr/src/app
- ./.docker/cache/composer:/composer/cache/
depends_on:
- nginx
php-fpm:
image: exozet/php-fpm:7.1.2
volumes:
- ./:/usr/src/app
nginx:
image: nginx:1.11.10
depends_on:
- php-fpm
ports:
- "8080:8080"
volumes:
- ./:/usr/src/app
- ./.docker/nginx.conf:/etc/nginx/conf.d/default.conf

0 comments on commit c2de885

Please sign in to comment.