Browse Source

swagger ui

pull/4/head
Johannes Schickling 9 years ago
parent
commit
d247946ce6
  1. 1
      README.md
  2. 2
      mysql-backup-s3/Dockerfile
  3. 22
      swagger-ui/Dockerfile
  4. 14
      swagger-ui/README.md
  5. 14
      swagger-ui/run.sh

1
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

2
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

22
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"]

14
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)

14
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
Loading…
Cancel
Save