File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ ENV OAUTH_APP_NAME "**None**"
1313ENV OAUTH_ADDITIONAL_PARAMS "**None**"
1414ENV SWAGGER_JSON "/app/swagger.json"
1515ENV PORT 80
16+ ENV BASE_URL ""
1617
1718RUN apk add --update nginx
1819RUN mkdir -p /run/nginx
Original file line number Diff line number Diff line change @@ -49,6 +49,14 @@ Or you can provide your own swagger.json on your host
4949docker run -p 80:8080 -e SWAGGER_JSON=/foo/swagger.json -v /bar:/foo swaggerapi/swagger-ui
5050```
5151
52+ The base URL of the web application can be changed by specifying the ` BASE_URL ` environment variable:
53+
54+ ```
55+ docker run -p 80:8080 -e BASE_URL=/swagger -e SWAGGER_JSON=/foo/swagger.json -v /bar:/foo swaggerapi/swagger-ui
56+ ```
57+
58+ This will serve Swagger UI at ` /swagger ` instead of ` / ` .
59+
5260##### Prerequisites
5361- Node 6.x
5462- NPM 3.x
Original file line number Diff line number Diff line change @@ -21,6 +21,16 @@ replace_or_delete_in_index () {
2121 fi
2222}
2323
24+ if [ " ${BASE_URL} " ]; then
25+ NGINX_WITH_BASE_URL=" ${NGINX_ROOT}${BASE_URL} "
26+
27+ mkdir -p ${NGINX_WITH_BASE_URL}
28+ mv ${NGINX_ROOT} /* .* ${NGINX_WITH_BASE_URL} /
29+
30+ INDEX_FILE=$NGINX_WITH_BASE_URL /index.html
31+ NGINX_ROOT=$NGINX_WITH_BASE_URL
32+ fi
33+
2434replace_in_index myApiKeyXXXX123456789 $API_KEY
2535replace_or_delete_in_index your-client-id $OAUTH_CLIENT_ID
2636replace_or_delete_in_index your-client-secret-if-required $OAUTH_CLIENT_SECRET
You can’t perform that action at this time.
0 commit comments