Created
August 15, 2019 08:02
-
-
Save madhums/4dfcde6588d13a1acb7b44e95a24958b to your computer and use it in GitHub Desktop.
docker with nginx and php-fpm
This file contains hidden or 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: '3.3' | |
services: | |
php: | |
image: php:7.1-fpm | |
volumes: | |
- .:/var/www/html | |
working_dir: /var/www/html | |
networks: | |
- web | |
nginx: | |
image: nginx | |
depends_on: | |
- php | |
working_dir: /var/www/html | |
volumes: | |
- .:/var/www/html | |
- ./nginx.conf:/etc/nginx/conf.d/web.conf:ro | |
ports: | |
- 8000:80 | |
networks: | |
- web | |
networks: | |
web: |
This file contains hidden or 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
<!-- ./code/index.php --> | |
<?php phpinfo(); ?> |
This file contains hidden or 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
server { | |
listen 80 default_server; | |
server_name localhost; | |
index index.php index.html; | |
root /var/www/html/code; | |
location ~ \.php$ { | |
try_files $uri =404; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass php:9000; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
include fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment