diff --git a/README.md b/README.md index 42d593b..0a6262c 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Collection of lightweight and ready-to-use docker images * **[OpenCV](https://github.com/schickling/dockerfiles/tree/master/opencv)** - Lightweight ready-to use OpenCV image * **[Redis-Commander](https://github.com/schickling/dockerfiles/tree/master/redis-commander)** - Redis management tool * **[Rust](https://github.com/schickling/dockerfiles/tree/master/rust)** - Lightweight nightly Rust build including Cargo and GDB +* **[swagger-ui](https://github.com/schickling/dockerfiles/tree/master/swagger-ui)** - Swagger UI 2.1.2 with API_URL and API_KEY injection (45 MB) ## FAQ diff --git a/mysql-backup-s3/Dockerfile b/mysql-backup-s3/Dockerfile index 5ebf450..c6b1456 100644 --- a/mysql-backup-s3/Dockerfile +++ b/mysql-backup-s3/Dockerfile @@ -13,8 +13,8 @@ ENV MYSQL_PASSWORD **None** ENV S3_ACCESS_KEY_ID **None** ENV S3_SECRET_ACCESS_KEY **None** ENV S3_BUCKET **None** -ENV S3_PATH 'backup' ENV S3_REGION us-west-1 +ENV S3_PATH 'backup' ENV SCHEDULE **None** ADD run.sh run.sh diff --git a/swagger-ui/Dockerfile b/swagger-ui/Dockerfile new file mode 100644 index 0000000..49f28be --- /dev/null +++ b/swagger-ui/Dockerfile @@ -0,0 +1,22 @@ +FROM mhart/alpine-node +MAINTAINER Johannes Schickling "schickling.j@gmail.com" + +ENV VERSION "v2.1.2" +ENV FOLDER "swagger-ui-2.1.2" +ENV API_URL "http://petstore.swagger.io/v2/swagger.json" +ENV API_KEY "**None**" + +WORKDIR /app + +RUN apk update && apk add openssl +RUN wget -qO- https://github.com/swagger-api/swagger-ui/archive/$VERSION.tar.gz | tar xvz +RUN cp -r $FOLDER/dist/* . && rm -rf $FOLDER +RUN npm install -g http-server +RUN apk del openssl + +ADD run.sh run.sh + +# webserver port +EXPOSE 80 + +CMD ["sh", "run.sh"] diff --git a/swagger-ui/README.md b/swagger-ui/README.md new file mode 100644 index 0000000..277bc09 --- /dev/null +++ b/swagger-ui/README.md @@ -0,0 +1,14 @@ +# swagger-ui + +Swagger UI 2.1.2 with API_URL and API_KEY injection (45 MB) + +## Usage + +```sh +$ docker run -d -p 80:80 -e API_URL=http://localhost:4000/swagger schickling/swagger-ui +``` + +### Variables + +* `API_URL` - Swagger endpoint for your API +* `API_KEY` - Default API Key (optional) diff --git a/swagger-ui/run.sh b/swagger-ui/run.sh new file mode 100644 index 0000000..6bbbc7e --- /dev/null +++ b/swagger-ui/run.sh @@ -0,0 +1,14 @@ +#! /bin/sh + +set -e + +if [ "$API_KEY" != "**None**" ]; then + sed -i "s|/\*||g" index.html + sed -i "s|\*/||g" index.html + sed -i "s|myApiKeyXXXX123456789|$API_KEY|g" index.html +fi + +sed -i "s|http://petstore.swagger.io/v2/swagger.json|$API_URL|g" index.html +sed -i "s|http://example.com/api|$API_URL|g" index.html + +http-server -p 80