-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.stub.yml
48 lines (46 loc) · 1.77 KB
/
docker-compose.stub.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
version: "3.0"
services:
# This service validates the incoming swagger.json file and builds a
# final version gathering all the components in one single file.
openapi_builder:
container_name: swagger_build
image: jeanberu/swagger-cli
# It will create a volume, copying all the files in your host root folder to /app
# folder inside container host
volumes:
- ./:/app
# This command bundle the providded swagger.json file and all its references and
# creates a new schema.json validated file that will be used in the next steps.
# As a volume was created, this file will be available in your project root directory.
command: swagger-cli bundle --outfile ./app/schema.json ./app/swagger.yaml
# This service run a Mock server in port 8000 using the schema.json file generated
# in the previous step.
openapi_mock:
container_name: server_mock
image: jormaechea/open-api-mocker
volumes:
- ./:/app
# Port mapping, the mock server will be exposed at port 8000 of your localhost. Inside
# dockers network the port to reach will be 5000.
ports:
- "8080:5000"
# This service can't start if openapi_builder didn't finish.
depends_on:
- openapi_builder
# This service run a Swagger UI, providing all the API info and documentation
# and exposes at port 80.
openapi_swagger:
container_name: swagger_ui
image: swaggerapi/swagger-ui
# Port mapping, the Swagger UI will be available at port :80 or https://localhost
ports:
- "80:8080"
# Swagger File to feed the Swagger UI
# Base URL to point for consulting the Swagger https://localhost/swagger
environment:
SWAGGER_JSON: /app/schema.json
BASE_URL: /swagger
volumes:
- ./:/app
depends_on:
- openapi_mock