How to serve local file with docker
See original GitHub issueI 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.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:11
Top Results From Across the Web
How to Serve Static Files with Nginx and Docker - Sabe.io
Let's learn how to serve a static website and static files using an Nginx instance running inside a Docker container.
Read more >halverneus/static-file-server - Docker Image
Tiny, simple static file server using environment variables for configuration. Install from any of the following locations:.
Read more >Serve static files from docker via nginx - A basic example
Our target is to create a simple HTML file, simple JS, CSS files. Host it inside a docker container. Serve it to outside...
Read more >The smallest Docker image to serve static websites | Florin Lipan
This will launch the server in foreground ( -f ), listening on port 3000 ( -p ), serving all files inside the current...
Read more >Docker Tutorial - Running A File Server | Web Server - YouTube
Creating File Server using docker filePlaylist: Docker Tutorial in English: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I used this and it works :
To be honest, the doc is unclear about SWAGGER_JSON environment variable.
thanks @AirDur here is docker run command