Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ENV API_KEY "**None**"
ENV SWAGGER_JSON "/app/swagger.json"
ENV PORT 8080
ENV BASE_URL ""
ENV SWAGGER_JSON_URL ""

COPY ./docker/nginx.conf ./docker/cors.conf /etc/nginx/

Expand Down
9 changes: 7 additions & 2 deletions docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ fi

replace_in_index myApiKeyXXXX123456789 $API_KEY

if [[ -f $SWAGGER_JSON ]]; then
cp -s $SWAGGER_JSON $NGINX_ROOT
if [ "$SWAGGER_JSON_URL" ]; then
sed -i "s|https://petstore.swagger.io/v2/swagger.json|$SWAGGER_JSON_URL|g" $INDEX_FILE
sed -i "s|http://example.com/api|$SWAGGER_JSON_URL|g" $INDEX_FILE
fi

if [[ -f "$SWAGGER_JSON" ]]; then
cp -s "$SWAGGER_JSON" "$NGINX_ROOT"
REL_PATH="./$(basename $SWAGGER_JSON)"
sed -i "s|https://petstore.swagger.io/v2/swagger.json|$REL_PATH|g" $INDEX_FILE
sed -i "s|http://example.com/api|$REL_PATH|g" $INDEX_FILE
Expand Down