Ubuntu 24.0 Docker - PHP-FPM + NGINX - PHP-FPM gives /index.php 404 error [closed]

23 hours ago 4
ARTICLE AD BOX

I have a docker setup with Laravel Application that works fine on local Mac however, I am facing issues with the deployment on Ubuntu server 24.0.

All my paths are correct

All my volumes are mapped correctly

I checked the file location which exists

I have correctly pointed the root for NGINX i.e. both the NGINX and PHP-FPM has the same folder structure /var/www/api/public

User & Group ID matches the host OS i.e. 1000:1000 in all containers

Permissions:

api: 755

api/storage : 775

api/bootstrap/cache: 775

Where could be the issue?

I have created a git repo for this setup here. The folder structure I have is:

Project Folder |- docker-laravel |- api

The log after running docker compose -f docker-compose.yml -f docker-compose.prod.yml logs php

log of docker container

Solution since this question was closed by contributors who didn't understand the question...

I was just playing around and fixed it.

Created a new folder Cloned repos with similar folder structure Build the image again using docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build Opened the container shell docker compose -f docker-compose.yml -f docker-compose.prod.yml exec php /bin/bash switched user to www inside the container su www installed dependencies composer install configured .env restarted container php

If I have to guess, the issue was caused by the root user which is required for supervisord. This has to be separated from php-fpm container.

Read Entire Article