-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can the docker container load the OpenAPI YAML specification from a local file #50
Comments
Hello, @dragonjuggler ! You can use valid file path instead of web URL. To share your local config file with the running container you have to use docker volume. See example of docker-compose config below. version: '3.0'
services:
openapi_mock:
container_name: openapi_mock
image: muonsoft/openapi-mock
environment:
OPENAPI_MOCK_SPECIFICATION_URL: '/app/petstore.yaml'
volumes:
- ./examples/petstore.yaml:/app/petstore.yaml
ports:
- "8080:8080" |
I can give this a try. How can you supply other options to the container? For example, for the standalone executable, I had to set cors_enabled to true to get things to work in my environment. And how can you get debug/trace information from the container when something doesn't work? I ran into a couple of different issues running the command line version. Would you like me to create a separate issue for those? |
Never mind about the configuration - I figured it out. All the configuration environment variables need to be supplied in the docker-compose file. This plus your earlier response would be useful to have in the documentation. |
Ok. I ran into a few wrinkles:
For #3, I tried the following definition:
But trying to access that URL results in an HTTP 404 Not found. |
Hi.
It looks like the docker version of this requires specifying a URL to load the YAML specification. I know that the container will not have access to a local file on the host, but has any method been looked into that would allow that? For example, having a configuration service or admin service for the docker container which would allow "setting" the specification via a browser?
The docker version is more desirable, since nothing really needs to be installed, but serving up a YAML spec from a web service is not desirable (during development, the file will only be local).
Thanks.
-Mark
The text was updated successfully, but these errors were encountered: