From 6d68bd38e7450b587c177c9d2e771845e8676e0f Mon Sep 17 00:00:00 2001 From: Lucky3028 Date: Sun, 17 Sep 2023 08:52:57 +0900 Subject: [PATCH 1/2] =?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 | 4 ++-- docker/Dockerfile | 10 ++++++++-- docker/entrypoint.sh | 4 ++++ 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 docker/entrypoint.sh diff --git a/compose.yaml b/compose.yaml index 6003cd2..9f3fa71 100644 --- a/compose.yaml +++ b/compose.yaml @@ -11,8 +11,8 @@ services: 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 From e3e9a7f7b93ff5e4633d054863cea05e60c78ed2 Mon Sep 17 00:00:00 2001 From: Lucky3028 Date: Sun, 17 Sep 2023 08:55:28 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=E4=B8=8D=E8=A6=81=E3=81=AA?= =?UTF-8?q?=E3=83=91=E3=83=83=E3=82=B1=E3=83=BC=E3=82=B8=E3=82=92=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0c0a523..59eb3de 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,7 +6,7 @@ ENV PORT=8080 EXPOSE 8080 -RUN npm install -g @redocly/cli kill-port http-server +RUN npm install -g @redocly/cli http-server USER node WORKDIR /tmp/files