Skip to content
This repository was archived by the owner on May 4, 2019. It is now read-only.

Commit 9eb4e00

Browse files
committed
Merge pull request swagger-api#2128 from romant/master
slimmed Docker image + usage
2 parents af0510b + 595f604 commit 9eb4e00

File tree

3 files changed

+34
-20
lines changed

3 files changed

+34
-20
lines changed

Dockerfile

+8-18
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
1-
###
2-
# swagger-ui-builder - https://github.com/swagger-api/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-
###
1+
FROM alpine:3.3
92

10-
FROM ubuntu:14.04
11-
3+
MAINTAINER Roman Tarnavski
124

13-
ENV DEBIAN_FRONTEND noninteractive
5+
RUN apk add --update nginx
146

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
7+
COPY nginx.conf /etc/nginx/
8+
ADD ./dist/ /usr/share/nginx/html
179

18-
WORKDIR /build
19-
ADD package.json /build/package.json
20-
RUN npm install
21-
ADD . /build
22-
CMD ./node_modules/gulp/bin/gulp.js serve
10+
EXPOSE 8080
11+
12+
CMD nginx -g 'daemon off;'

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ To build swagger-ui using a docker container:
5555

5656
```
5757
docker build -t swagger-ui-builder .
58-
docker run -p 127.0.0.1:8080:8080 swagger-ui-builder
58+
docker run -p 80:8080 swagger-ui-builder
5959
```
6060

61-
This will start Swagger UI at `http://localhost:8080`.
61+
This will start Swagger UI at `http://localhost`.
6262

6363
### Use
6464
Once you open the Swagger UI, it will load the [Swagger Petstore](http://petstore.swagger.io/v2/swagger.json) service and show its APIs. You can enter your own server url and click explore to view the API.

nginx.conf

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
worker_processes 1;
2+
3+
events {
4+
worker_connections 1024;
5+
}
6+
7+
http {
8+
include mime.types;
9+
default_type application/octet-stream;
10+
11+
sendfile on;
12+
13+
keepalive_timeout 65;
14+
15+
server {
16+
listen 8080;
17+
server_name localhost;
18+
19+
location / {
20+
root html;
21+
index index.html index.htm;
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)