From 135839d3ff1ed5f234e69505b03d68cb45caa147 Mon Sep 17 00:00:00 2001 From: Arian Rahimi Date: Mon, 17 Feb 2020 17:12:15 +0330 Subject: [PATCH] chro: change the docker - add description to the index.html and docker environment - change the way of redoc init --- config/docker/Dockerfile | 5 +- config/docker/docker-run.sh | 1 + config/docker/index.tpl.html | 13 ++++- yarn.lock | 102 ++++++++++++++++++++++++++++++++++- 4 files changed, 116 insertions(+), 5 deletions(-) diff --git a/config/docker/Dockerfile b/config/docker/Dockerfile index c7c67307..73e92ac6 100644 --- a/config/docker/Dockerfile +++ b/config/docker/Dockerfile @@ -7,7 +7,7 @@ FROM node:alpine -RUN apk update && apk add --no-cache git +RUN apk update && apk add --no-cache git # Install dependencies WORKDIR /build @@ -24,10 +24,11 @@ RUN npm run bundle:standalone FROM nginx:alpine ENV PAGE_TITLE="ReDoc" +ENV PAGE_DESCRIPTION="" ENV PAGE_FAVICON="favicon.png" ENV SPEC_URL="http://petstore.swagger.io/v2/swagger.json" ENV PORT=80 -ENV REDOC_OPTIONS= +ENV REDOC_OPTIONS="{}" # copy files to the nginx folder COPY --from=0 build/bundles /usr/share/nginx/html diff --git a/config/docker/docker-run.sh b/config/docker/docker-run.sh index 2706b243..2f33b0a5 100644 --- a/config/docker/docker-run.sh +++ b/config/docker/docker-run.sh @@ -3,6 +3,7 @@ set -e sed -i -e "s|%PAGE_TITLE%|$PAGE_TITLE|g" /usr/share/nginx/html/index.html +sed -i -e "s|%PAGE_DESCRIPTION%|$PAGE_DESCRIPTION|g" /usr/share/nginx/html/index.html sed -i -e "s|%PAGE_FAVICON%|$PAGE_FAVICON|g" /usr/share/nginx/html/index.html sed -i -e "s|%SPEC_URL%|$SPEC_URL|g" /usr/share/nginx/html/index.html sed -i -e "s|%REDOC_OPTIONS%|${REDOC_OPTIONS}|g" /usr/share/nginx/html/index.html diff --git a/config/docker/index.tpl.html b/config/docker/index.tpl.html index 0066d46d..a1726ecc 100644 --- a/config/docker/index.tpl.html +++ b/config/docker/index.tpl.html @@ -4,6 +4,14 @@ %PAGE_TITLE% + + + + + + + +