Answer the question
In order to leave comments, you need to log in
How to make nginx look in the right folder of Laravel project wrapped in Docker?
Hello.
There is a Laravel project with this docker-compose :
version: '3.7'
services:
php-fpm:
container_name: crm_php-fpm
build:
context: .
dockerfile: Dockerfile.php-fpm.${ENV}
volumes:
- ./app:/var/www
environment:
- REDIS_PORT=6379
- REDIS_HOST=redis
- DB_CONNECTION=pgsql
- DB_PORT=5432
- DB_HOST=pgsql
ports:
- 9001:9000
php-cli:
container_name: crm_php-cli
build:
context: .
dockerfile: Dockerfile.php-cli.${ENV}
volumes:
- ./app:/var/www
environment:
- REDIS_PORT=6379
- REDIS_HOST=redis
- DB_CONNECTION=pgsql
- DB_PORT=5432
- DB_HOST=pgsql
restart: always
tty: true
pgsql:
container_name: crm_pgsql
image: postgres:9.6-alpine
environment:
- POSTGRES_USER=app
- POSTGRES_PASSWORD=app
- POSTGRES_DATABASE=secret
ports:
- 54321:5432
volumes:
- ././storage/postgres:/var/lib/postgresql/data
node:
container_name: crm_node
image: node:10.11-jessie
volumes:
- ${APP_PATH_HOST}:/var/www
working_dir: /var/www
tty: true
redis:
container_name: crm_redis
image: redis:5.0
ports:
- 63793:6379
server
{
listen 82;
index index.php index.html;
root /home/andrey/PhpStormProjects/crm/app;
location / {
try_files $uri /index.php?$args;
}
location /docs {
try_files $uri $uri/;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass localhost:9001;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
curl localhost:82
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question