diff --git a/Dockerrun.aws.json b/Dockerrun.aws.json new file mode 100644 index 00000000..8fe11a9d --- /dev/null +++ b/Dockerrun.aws.json @@ -0,0 +1,63 @@ +{ + "AWSEBDockerrunVersion": 2, + "volumes": [ + { + "name": "php-app", + "host": { + "sourcePath": "/var/app/current/php-app" + } + }, + { + "name": "nginx-proxy-conf", + "host": { + "sourcePath": "/var/app/current/proxy/conf.d" + } + } + ], + "containerDefinitions": [ + { + "name": "php-app", + "image": "php:fpm", + "essential": true, + "memory": 128, + "mountPoints": [ + { + "sourceVolume": "php-app", + "containerPath": "/var/www/html", + "readOnly": true + } + ] + }, + { + "name": "nginx-proxy", + "image": "nginx", + "essential": true, + "memory": 128, + "portMappings": [ + { + "hostPort": 80, + "containerPort": 80 + } + ], + "links": [ + "php-app" + ], + "mountPoints": [ + { + "sourceVolume": "php-app", + "containerPath": "/var/www/html", + "readOnly": true + }, + { + "sourceVolume": "awseb-logs-nginx-proxy", + "containerPath": "/var/log/nginx" + }, + { + "sourceVolume": "nginx-proxy-conf", + "containerPath": "/etc/nginx/conf.d", + "readOnly": true + } + ] + } + ] +} \ No newline at end of file diff --git a/php-app/index.php b/php-app/index.php new file mode 100644 index 00000000..bb2563b1 --- /dev/null +++ b/php-app/index.php @@ -0,0 +1,3 @@ +

Hello World!!!

+

PHP Version

+Static HTML Page \ No newline at end of file diff --git a/php-app/static.html b/php-app/static.html new file mode 100644 index 00000000..8a5f088e --- /dev/null +++ b/php-app/static.html @@ -0,0 +1,2 @@ +

This is a static HTML page

+Go Back \ No newline at end of file diff --git a/proxy/conf.d/default.conf b/proxy/conf.d/default.conf new file mode 100644 index 00000000..c8175402 --- /dev/null +++ b/proxy/conf.d/default.conf @@ -0,0 +1,22 @@ +server { + listen 80; + server_name localhost; + root /var/www/html; + + index index.php; + + location ~ [^/]\.php(/|$) { + fastcgi_split_path_info ^(.+?\.php)(/.*)$; + if (!-f $document_root$fastcgi_script_name) { + return 404; + } + + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; + + fastcgi_pass php-app:9000; + fastcgi_index index.php; + } +} \ No newline at end of file