From 866e54d56b3b2e36c7ad0f3a845f863e8fd5b5a3 Mon Sep 17 00:00:00 2001 From: 4geru Date: Tue, 10 Jun 2025 13:18:35 +0900 Subject: [PATCH 1/3] add the open api execute command --- Makefile | 9 +++++++++ README.md | 12 ++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..df477a6 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +.PHONY: docker/open-api-doc +PORT ?= 8080 +docker/open-api-doc: + docker run --rm --name line-open-api-doc \ + -p $(PORT):8080 \ + -e PORT=8080 \ + -e API_URL=/openapi/messaging-api.yml \ + -v ./:/usr/share/nginx/html/openapi \ + swaggerapi/swagger-ui:latest diff --git a/README.md b/README.md index 2e0fb50..3815a32 100644 --- a/README.md +++ b/README.md @@ -44,3 +44,15 @@ Please note the following guidelines: - OpenAPI Generator can't generate Python client with Java 17+ - https://github.com/OpenAPITools/openapi-generator/issues/13684 + +## Usage + +You can launch the Swagger UI to browse the OpenAPI specs locally using Docker and the provided Makefile. + +```sh +make docker/open-api-doc +``` + +By default, the Swagger UI will be available at: [http://localhost:8080](http://localhost:8080) + +If you want to use a different port, edit the `-p` option in the `Makefile`. From 0690bb5cd55f7de141516fb963aff4942bdc3885 Mon Sep 17 00:00:00 2001 From: 4geru Date: Thu, 19 Jun 2025 09:00:33 +0900 Subject: [PATCH 2/3] remove Makefile --- Makefile | 9 --------- README.md | 6 ++---- 2 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index df477a6..0000000 --- a/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -.PHONY: docker/open-api-doc -PORT ?= 8080 -docker/open-api-doc: - docker run --rm --name line-open-api-doc \ - -p $(PORT):8080 \ - -e PORT=8080 \ - -e API_URL=/openapi/messaging-api.yml \ - -v ./:/usr/share/nginx/html/openapi \ - swaggerapi/swagger-ui:latest diff --git a/README.md b/README.md index 3815a32..cf9d57e 100644 --- a/README.md +++ b/README.md @@ -47,12 +47,10 @@ Please note the following guidelines: ## Usage -You can launch the Swagger UI to browse the OpenAPI specs locally using Docker and the provided Makefile. +You can launch the Swagger UI to browse the OpenAPI specs locally using Docker. ```sh -make docker/open-api-doc +docker run --rm --name line-open-api-doc -p 8080:8080 -e PORT=8080 -e API_URL=/openapi/messaging-api.yml -v ./:/usr/share/nginx/html/openapi swaggerapi/swagger-ui:latest ``` By default, the Swagger UI will be available at: [http://localhost:8080](http://localhost:8080) - -If you want to use a different port, edit the `-p` option in the `Makefile`. From 22171b7765630f3c24c69b90dcee62d197e6c5fa Mon Sep 17 00:00:00 2001 From: 4geru Date: Thu, 19 Jun 2025 09:03:15 +0900 Subject: [PATCH 3/3] change the docker compose up --- README.md | 7 ++++++- docker-compose.yml | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yml diff --git a/README.md b/README.md index cf9d57e..96e7be0 100644 --- a/README.md +++ b/README.md @@ -48,9 +48,14 @@ Please note the following guidelines: ## Usage You can launch the Swagger UI to browse the OpenAPI specs locally using Docker. +First, make sure you have `docker-compose.yml` in this directory. Then run: ```sh -docker run --rm --name line-open-api-doc -p 8080:8080 -e PORT=8080 -e API_URL=/openapi/messaging-api.yml -v ./:/usr/share/nginx/html/openapi swaggerapi/swagger-ui:latest +docker-compose up ``` By default, the Swagger UI will be available at: [http://localhost:8080](http://localhost:8080) + +### Using Docker Command + +Alternatively, you can use the following Docker command: diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..1d24bb3 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3.8' +services: + swagger-ui: + image: swaggerapi/swagger-ui:latest + container_name: line-open-api-doc + ports: + - "8080:8080" + environment: + - PORT=8080 + - API_URL=/openapi/messaging-api.yml + volumes: + - ./:/usr/share/nginx/html/openapi \ No newline at end of file