Skip to content

Commit 2f7a4a3

Browse files
committed
Add Dockerfile and notes to README.
1 parent 03dd9fb commit 2f7a4a3

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.git
2+
node_modules
3+
bower_components
4+
*.swp

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
###
2+
# swagger-ui-builder - https://github.com/wordnik/swagger-ui/
3+
# Container for building the swagger-ui static site
4+
#
5+
# Build: docker build -t swagger-ui-builder .
6+
# Run: docker run -v $PWD/dist:/build/dist swagger-ui-builder
7+
#
8+
###
9+
10+
FROM ubuntu:14.04
11+
12+
13+
ENV DEBIAN_FRONTEND noninteractive
14+
15+
RUN apt-get update && apt-get install -y git npm nodejs openjdk-7-jre
16+
RUN ln -s /usr/bin/nodejs /usr/local/bin/node
17+
18+
WORKDIR /build
19+
ADD package.json /build/package.json
20+
RUN npm install
21+
ADD . /build
22+
CMD PATH=$PATH:node_modules/.bin cake dist

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ You can rebuild swagger-ui on your own to tweak it or just so you can say you di
3838
4. npm run-script build
3939
5. You should see the distribution under the dist folder. Open ./dist/index.html to launch Swagger UI in a browser
4040

41+
### Build using Docker
42+
43+
To build swagger-ui using a docker container:
44+
45+
```
46+
docker build -t swagger-ui-builder .
47+
docker run -v $PWD/dist:/build/dist swagger-ui-builder
48+
```
49+
4150
### Use
4251
Once you open the Swagger UI, it will load the [Swagger Petstore](http://petstore.swagger.wordnik.com/api/api-docs) service and show its APIs. You can enter your own server url and click explore to view the API.
4352

0 commit comments

Comments
 (0)