-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#12 changes swaggerui installation process
- Loading branch information
cwolfes
committed
Apr 13, 2022
1 parent
44f659d
commit 9bc6084
Showing
3 changed files
with
27 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
[submodule "swagger-ui"] | ||
path = swagger-ui | ||
url = https://github.com/cloudogu/swagger-ui.git | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
FROM node:10 AS build | ||
# separate COPY and RUN commands to use docker build cache | ||
COPY swagger-ui/package.json /usr/share/build/swagger-ui/package.json | ||
COPY swagger-ui/package-lock.json /usr/share/build/swagger-ui/package-lock.json | ||
WORKDIR /usr/share/build/swagger-ui | ||
RUN npm i | ||
COPY / /usr/share/build/ | ||
RUN npm run build | ||
|
||
FROM registry.cloudogu.com/official/base:3.15.3-1 | ||
LABEL NAME="official/swaggerui" \ | ||
VERSION="3.25.0-2" \ | ||
VERSION="4.9.0-1" \ | ||
maintainer="[email protected]" | ||
|
||
ENV SERVICE_TAGS=webapp | ||
ENV SERVICE_TAGS=webapp \ | ||
SWAGGERUI_VERSION=4.9.0-1 \ | ||
SWAGGERUI_ZIP_SHA256="0bfecf30a09247936eed6ec2d5d8ddba3b1a847e24017cd3876ddce5b33736ce" \ | ||
NGINX_HOME="/var/www/html" | ||
|
||
COPY resources / | ||
|
||
RUN set -x -o errexit -o nounset -o pipefail \ | ||
&& apk update \ | ||
&& apk upgrade \ | ||
# install required packages | ||
&& apk --update add openssl pcre zlib nginx \ | ||
# change owner of nginx binary | ||
&& chown root:root /usr/sbin/nginx \ | ||
# redirect logs | ||
&& ln -sf /dev/stdout /var/log/nginx/access.log \ | ||
&& ln -sf /dev/stderr /var/log/nginx/error.log \ | ||
# cleanup apk cache | ||
&& rm -rf /var/cache/apk/* \ | ||
&& mkdir -p /var/www/html | ||
&& apk update \ | ||
&& apk upgrade \ | ||
# install required packages | ||
&& apk --update add openssl pcre zlib nginx \ | ||
# change owner of nginx binary | ||
&& chown root:root /usr/sbin/nginx \ | ||
# redirect logs | ||
&& ln -sf /dev/stdout /var/log/nginx/access.log \ | ||
&& ln -sf /dev/stderr /var/log/nginx/error.log \ | ||
# cleanup apk cache | ||
&& rm -rf /var/cache/apk/* \ | ||
&& mkdir -p ${NGINX_HOME} \ | ||
# install swaggerui from fork https://github.com/cloudogu/swagger-ui/releases/ \ | ||
&& curl -Lsk --fail --silent --location --retry 3 https://github.com/cloudogu/swagger-ui/releases/download/v${SWAGGERUI_VERSION}/swagger-ui-${SWAGGERUI_VERSION}.zip -o /tmp/swagger-ui.zip \ | ||
&& echo "${SWAGGERUI_ZIP_SHA256} */tmp/swagger-ui.zip" | sha256sum -c - \ | ||
&& unzip /tmp/swagger-ui.zip -d ${NGINX_HOME} \ | ||
&& mv ${NGINX_HOME}/dist/* ${NGINX_HOME} \ | ||
# cleanup | ||
&& rm -r ${NGINX_HOME}/dist && rm /tmp/swagger-ui.zip | ||
|
||
# copy files | ||
COPY resources / | ||
COPY --from=build /usr/share/build/swagger-ui/dist/* /var/www/html/ | ||
|
||
# Define working directory. | ||
WORKDIR /etc/nginx | ||
|
||
|
@@ -41,4 +41,4 @@ HEALTHCHECK CMD doguctl healthy swaggerui || exit 1 | |
EXPOSE 8080 | ||
|
||
# Define default command. | ||
CMD ["/startup.sh"] | ||
CMD ["/startup.sh"] |
Submodule swagger-ui
deleted from
e69cf4