Okay, I know this sounds weird ... but: The SwaggerUI is not working inside of Docker. ^^"
Let me explain what I did. When I write down everything like in the example for axum and I start the application with cargo run, I can see the swagger-ui and also see the /docs/openapi.json file.
Now the interesting part, when I compile the code inside docker and provide it inside docker only the swagger-ui endpoint (/docs in this example) is returning a 404 Not Found. But the interesting thing is, all other endpoints are working... Including the /docs/opanapi.json endpoint.
So, only the swagger-ui isn't working inside Docker. ^^"
I thought "maybe it's a compiled problem", so I copied the locally build binary (which worked on the machine and showed the swagger-ui) into the docker container, started it and "boom", no swagger-ui. ^^"
It's so weird that every endpoint is working, also the openapi.json endpoint (which shows the full generated openapi json), but only the swagger-ui HTML-Page is not working. There is really no difference inside the Docker container and my local machine (like I said, I copied the binary to prove my assumption).
I also tried bigger OS containers like ubuntu and smaller ones like alpine, in all containers every endpoint is working, except the swagger-ui. :(
Does someone have an idea what I could test/think of? I'm getting out of ideas. ^^"
Okay, I know this sounds weird ... but: The SwaggerUI is not working inside of Docker. ^^"
Let me explain what I did. When I write down everything like in the example for
axumand I start the application withcargo run, I can see theswagger-uiand also see the/docs/openapi.jsonfile.Now the interesting part, when I compile the code inside docker and provide it inside docker only the
swagger-uiendpoint (/docsin this example) is returning a404 Not Found. But the interesting thing is, all other endpoints are working... Including the/docs/opanapi.jsonendpoint.So, only the
swagger-uiisn't working inside Docker. ^^"I thought "maybe it's a compiled problem", so I copied the locally build binary (which worked on the machine and showed the swagger-ui) into the docker container, started it and "boom", no swagger-ui. ^^"
It's so weird that every endpoint is working, also the
openapi.jsonendpoint (which shows the full generated openapi json), but only theswagger-uiHTML-Page is not working. There is really no difference inside the Docker container and my local machine (like I said, I copied the binary to prove my assumption).I also tried bigger OS containers like
ubuntuand smaller ones likealpine, in all containers every endpoint is working, except theswagger-ui. :(Does someone have an idea what I could test/think of? I'm getting out of ideas. ^^"