swagger-api / swagger-api/swagger-ui
How to serve local file with docker
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
I am following the instructions to set up a docker container with a local API docs file, with an api.yaml file in the local repo in the folder $HOME/my-app, and launching the container as follows:
docker run -p 80:8080 -e SWAGGER_JSON=/docs/api.yaml -v $HOME/my-app:/docs swaggerapi/swagger-ui
However, it returns in a 404 ("GET /docs/api.yaml HTTP/1.1" 404 126).
It's not clear what I'm doing wrong and any help would be appreciated.
Thanks for reading.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with docs/usage/installation.md at the Docker section and reproduce the reported command using a local api.yaml mounted at /docs. Check why the documented SWAGGER_JSON path produces a 404, then update the Docker instructions so the local-file setup and successful result are unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- devops
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100