Skip to content

Commit

Permalink
chore: Redoclyのコンテナが動かない不具合を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucky3028 committed Sep 16, 2023
1 parent 4cbdcd1 commit 6d68bd3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 4 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

redocly build-docs /schema/openapi.yml -o ./docs/index.html -t ./template.hbs
http-server ./docs -p $PORT

0 comments on commit 6d68bd3

Please sign in to comment.