laravel-swagger-ui icon indicating copy to clipboard operation
laravel-swagger-ui copied to clipboard

Incorrect server resolution when deployed with docker

Open mareg opened this issue 6 months ago • 0 comments

When I run my app using php artisan serve, it correctly sets the server URL to http://localhost:8000/.

Image

When I deploy my app to ECS, it ignores server:url values from the spec and presents me with only one option: 0.0.0.0:8000. Then, when I want to execute any of the requests, it adds that value to the request URL, so it looks like this: .../swagger/0.0.0.0:8000/api/....

            'server_url' => env('SWAGGER_URL'),

I have tried to modify config/swagger-ui.php by setting a custom ENV variable SWAGGER_URL with my server's public URL, but no luck, swagger-ui still shows this:

Image

And the request URL contains .../swagger/0.0.0.0:8000/api/......

What am I doing wrong? 🤔

mareg avatar Apr 17 '25 12:04 mareg