From 4d3331277dc0f9f569296eeb3d5af6987d4c4383 Mon Sep 17 00:00:00 2001 From: Michael Truong Date: Tue, 23 Aug 2016 20:55:17 +0000 Subject: [PATCH] Allow overriding of default serving port for Swagger UI --- swagger-ui/Dockerfile | 1 + swagger-ui/README.md | 1 + swagger-ui/run.sh | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/swagger-ui/Dockerfile b/swagger-ui/Dockerfile index 45fa63b..cdf9854 100644 --- a/swagger-ui/Dockerfile +++ b/swagger-ui/Dockerfile @@ -6,6 +6,7 @@ ENV FOLDER "swagger-ui-2.2.0" ENV API_URL "http://petstore.swagger.io/v2/swagger.json" ENV API_KEY "**None**" ENV SWAGGER_JSON "/app/swagger.json" +ENV PORT 80 WORKDIR /app diff --git a/swagger-ui/README.md b/swagger-ui/README.md index fb1ed39..bcba426 100644 --- a/swagger-ui/README.md +++ b/swagger-ui/README.md @@ -12,3 +12,4 @@ $ docker run -d -p 80:80 -e API_URL=http://localhost:4000/swagger schickling/swa * `API_URL` - Swagger endpoint for your API * `API_KEY` - Default API Key (optional) +* `PORT` - Default port to run on (optional) diff --git a/swagger-ui/run.sh b/swagger-ui/run.sh index ba5484d..22bca36 100644 --- a/swagger-ui/run.sh +++ b/swagger-ui/run.sh @@ -16,4 +16,4 @@ else sed -i "s|http://example.com/api|$API_URL|g" index.html fi -exec http-server -p 80 +exec http-server -p $PORT $*