Supporting multiple files in docker container
See original GitHub issueI am having trouble supporting multiple files inside the swaggerapi/swagger-ui
docker container.
Here is my docker compose:
swaggerui:
image: swaggerapi/swagger-ui
ports:
- "7000:8080"
environment:
- SWAGGER_JSON=/swagger/swagger.yml
volumes:
- ./Swagger:/swagger
I would expect this to serve swagger.yml out of the /swagger directory that is mounted.
docker exec -it -name- ls swagger
I can see all my files here, swagger.yml, user.swagger.yml, etc
But this is not the root of the nginx web server running in the container:
location / {
alias /usr/share/nginx/html/;
Looks like swagger.yml is copied over to /user/share/nginx/html/. This means that my files I want to reference in my swagger.yml are not available to be served by nginx.
This doesn’t seem like it should be the default behavior, how can I support loading in the other files found in my mounted volume? Perferably without having to modify my swagger.yml to have a strange path I would only use in docker (we are using it only for local). It should also use the volume as a source so I can make changes locally.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8 (1 by maintainers)
Top GitHub Comments
Here’s what I ended up doing, combining the knowledge from above:
To solve the dependency problem nginx could be updated to serve all .yml and .json files from a mount