Laravel
3
Вклад в тег
version: '3'
services:
nginx:
image: nginx:latest
ports:
- 80:80
volumes:
- ./:/var/www/html
- ./docker/nginx/conf.d:/etc/nginx/conf.d
- ./docker/nginx/logs:/var/log/nginx/
php:
image: php:7.2-fpm
volumes:
- ./:/var/www/html
db:
image: mysql:latest
environment:
MYSQL_DATABASE: labbit
MYSQL_ROOT_PASSWORD: rootlabbit
MYSQL_USER: labbit
MYSQL_PASSWORD: labbit
ports:
- 3306:3306
volumes:
- db_data:/var/lib/mysql
redis:
image: redis:latest
volumes:
db_data:
server {
listen 80;
listen [::]:80;
server_name labbit.local www.labbit.local;
root /var/www/html/public/;
index index.php;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
root /var/www/html/public/;
try_files $uri $uri/ /index.php$is_args$args;
autoindex off;
index index.php;
}
location ~ \.php$ {
set $path_info $fastcgi_path_info;
root /var/www/html/public/;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
try_files $uri $uri/;
include /etc/nginx/fastcgi_params;
fastcgi_pass php:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}