-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.doc
37 lines (30 loc) · 965 Bytes
/
Dockerfile.doc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM nginx:1.13
ARG SWAGGER_UI_VERSION=3.14.0
ARG VERSION
WORKDIR /var/www
# Copy Nginx configuration
COPY infrastructure/doc/etc/nginx/default.conf /etc/nginx/conf.d/
# Copy OpenAPI specification
COPY doc/openapi.yml doc/openapi.yml
RUN sed -ie "s/^ version: unknown$/ version: ${VERSION}/" doc/openapi.yml
# Install dependencies
RUN set -ex ; \
apt-get update ; \
apt-get install -y \
curl \
unzip
# Install Swagger UI
RUN set -ex ; \
curl -L https://github.com/swagger-api/swagger-ui/archive/v${SWAGGER_UI_VERSION}.zip -o /tmp/swagger-ui.zip ; \
unzip /tmp/swagger-ui.zip -d /tmp/ ; \
cp -rv /tmp/swagger-ui-${SWAGGER_UI_VERSION}/dist/* /var/www/ ; \
sed -i 's@http://petstore.swagger.io/v2/swagger.json@/doc/openapi.yml@' index.html
# Clean up
RUN set -ex ; \
apt-get purge -y \
curl \
unzip \
; \
apt autoremove -y ; \
rm -rf /var/lib/apt/lists/* ; \
rm -rf /tmp/swagger-ui*