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..59eb3de 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 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