如何使用docker-compose创buildLEMP堆栈?

我想创build一个LEMP堆栈的docker-compose为本地web开发,但我有一些麻烦…

我写的configuration文件:

泊坞窗,compose.yml

nginx: image: nginx:latest ports: - "8080:80" volumes: - ./web:/web - ./mysite.template:/etc/nginx/conf.d/mysite.template links: - php command: /bin/bash -c "envsubst < /etc/nginx/conf.d/mysite.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'" php: image: php:7-fpm volumes: - ./web:/web 

mysite.template

 server { listen 80; root /web; index index.php index.html; server_name default_server; location ~ \.php$ { fastcgi_pass php:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME /web$fastcgi_script_name; } } 

问题是,当我尝试打开http://localhost:8080结果是一个访问被拒绝

我该如何解决它?

编辑:
这是nginx容器错误日志:

 nginx_1 | 2017/11/01 13:21:25 [error] 8#8: *1 FastCGI sent in stderr: "Access to the script '/web' has been denied (see security.limit_extensions)" while reading response header from upstream 

我可以通过将docker-compose.yml为:

 nginx: image: nginx:latest ports: - "8080:80" volumes: - ./web:/web - ./mysite.template:/etc/nginx/conf.d/default.conf links: - php php: image: php:7-fpm volumes: - ./web:/web