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 207ffb2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
24 changes: 12 additions & 12 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -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
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 207ffb2

Please sign in to comment.