Skip to content

Commit cae5bd6

Browse files
committed
Add laravel nginx conf and Update readme
1 parent ffce198 commit cae5bd6

File tree

4 files changed

+53
-4
lines changed

4 files changed

+53
-4
lines changed

.env renamed to .env.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
APP_PATH=./..
77

88
# Nginx
9-
NGINX_HOST=symfony2.docker
9+
NGINX_HOST=laravel.docker
1010

1111
# PHP
1212
PHP_VERSION=7.2

README.MD

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
Inspired from: https://github.com/nanoninja/docker-nginx-php-mysql
1+
Inspired from: https://github.com/nanoninja/docker-nginx-php-mysql
2+
## How to use
3+
- Copy environment file `.env.dist` to `.env`
4+
- Edit parameters in the `.env` file: `NGINX_HOST`
5+
- Choose the Nginx configuration will be use in `docker-compose.yml` file
6+
- Make sure the ports using in the docker-compose will be free
7+
- Run `docker-compose up -d`
8+
## Issues
9+
Message: `Error starting userland proxy`
10+
OS: Windows 10
11+
Fix: Restart Docker
12+
Fix #2: Uncheck Fast startup option
13+
Url: https://github.com/docker/for-win/issues/573

docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
volumes:
66
- "./etc/ssl:/etc/ssl"
77
- "${APP_PATH}:/var/www/html"
8-
- "./etc/nginx/symfony2.conf:/etc/nginx/conf.d/default.template"
8+
- "./etc/nginx/laravel.conf:/etc/nginx/conf.d/default.template"
99
ports:
1010
- "8010:80"
1111
- "3010:443"
@@ -25,7 +25,6 @@ services:
2525
- "${APP_PATH}:/var/www/html"
2626
depends_on:
2727
- mysqldb
28-
command: /bin/bash -c "composer install"
2928
mysqldb:
3029
image: mysql:${MYSQL_VERSION}
3130
container_name: ${MYSQL_HOST}

etc/nginx/laravel.conf

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
server {
2+
listen 80;
3+
server_name ${NGINX_HOST};
4+
root /var/www/html/public;
5+
6+
index index.html index.htm index.php;
7+
8+
charset utf-8;
9+
10+
location / {
11+
try_files $uri $uri/ /index.php$is_args$args;
12+
}
13+
14+
location = /favicon.ico { access_log off; log_not_found off; }
15+
location = /robots.txt { access_log off; log_not_found off; }
16+
17+
access_log off;
18+
error_log /var/log/nginx/error.log error;
19+
20+
sendfile off;
21+
22+
client_max_body_size 100m;
23+
24+
location ~ \.php$ {
25+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
26+
fastcgi_pass php:9000;
27+
fastcgi_index index.php;
28+
include fastcgi_params;
29+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
30+
fastcgi_intercept_errors off;
31+
fastcgi_buffer_size 16k;
32+
fastcgi_buffers 4 16k;
33+
}
34+
35+
location ~ /\.ht {
36+
deny all;
37+
}
38+
}

0 commit comments

Comments
 (0)