From 207ffb2d854d984d79362626cbf092c2e886adc5 Mon Sep 17 00:00:00 2001 From: Lucky3028 Date: Sun, 17 Sep 2023 08:52:57 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20Redocly=E3=81=AE=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=83=86=E3=83=8A=E3=81=8C=E5=8B=95=E3=81=8B=E3=81=AA=E3=81=84?= =?UTF-8?q?=E4=B8=8D=E5=85=B7=E5=90=88=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compose.yaml | 24 ++++++++++++------------ docker/Dockerfile | 10 ++++++++-- docker/entrypoint.sh | 4 ++++ 3 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 docker/entrypoint.sh diff --git a/compose.yaml b/compose.yaml index 6003cd2..7d8a1ec 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,18 +1,18 @@ services: - swagger-ui: - image: swaggerapi/swagger-ui - container_name: swagger-ui - ports: - - 127.0.0.1:8081:8080 - volumes: - - ./schema:/schema - environment: - SWAGGER_JSON: /schema/openapi.yml - restart: always + # swagger-ui: + # image: swaggerapi/swagger-ui + # container_name: swagger-ui + # ports: + # - 127.0.0.1:8081:8080 + # volumes: + # - ./schema:/schema + # environment: + # SWAGGER_JSON: /schema/openapi.yml + # restart: always redocly: build: - context: ./docker - dockerfile: Dockerfile + context: . + dockerfile: ./docker/Dockerfile container_name: redocly ports: - 127.0.0.1:8082:8080 diff --git a/docker/Dockerfile b/docker/Dockerfile index f22da4b..0c0a523 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,6 +6,12 @@ ENV PORT=8080 EXPOSE 8080 -RUN npm install -g @redocly/cli +RUN npm install -g @redocly/cli kill-port http-server -ENTRYPOINT ["sh", "-c", "redocly preview-docs $SPEC_URL --port $PORT --host 0.0.0.0 --force"] +USER node +WORKDIR /tmp/files + +COPY --chmod=554 --chown=node:node ./docker/entrypoint.sh . +COPY --chown=node:node ./.github/template.hbs . + +ENTRYPOINT ["./entrypoint.sh"] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 0000000..dd1066a --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +redocly build-docs /schema/openapi.yml -o ./docs/index.html -t ./template.hbs +http-server ./docs -p $PORT