I am having a hard time getting subdomains to work locally. I have Docker serving the application to port 8080, and I am able to see the Laravel welcome screen.It's great for both development and deployment because it allows you to make an environment that runs equally well on any system or operating system. Thus, Laravel + Docker provides portable, consistent development environments with which you can develop better.
Laravel and docker with subdomains
Hi. I have a project that I want to play around with and dockerize, but I’m hitting a few problems that I can’t quite get past.
The project uses 2 routes that are subdomains that’s set in the routes/customer.php and routes/admin.php files. They are set to ‘admin.mydomain.test’ and ‘dashboard.mydomain.test’ for local.
I’m using the following Docket config https://github.com/vshloda/docker-laravel.
My question is, do I need to add a new service in the dockerfile for the subdomains so there’s a admin_app and a dashboard_app? Also (which is where I think the issue maybe) is the nginx file. I’ve set it up so that it points to the two subdomains, but it won’t load the page, giving an error about DNS not found or similar. I’ve tried a few variations of it but can’t get it to load.
Any help or info would be grateful.
Many thanks
Please or to participate in this conversation.