forked from OpenIdentityPlatform/OpenIG
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-alpine
More file actions
34 lines (26 loc) · 1.47 KB
/
Dockerfile-alpine
File metadata and controls
34 lines (26 loc) · 1.47 KB
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
FROM tomcat:9-jre8-alpine
LABEL org.opencontainers.image.authors="Open Identity Platform Community"
ARG VERSION
ENV CATALINA_HOME=/usr/local/tomcat
ENV OPENIG_USER="openig"
ENV OPENIG_BASE=/var/openig
ENV PATH=$CATALINA_HOME/bin:$PATH
ENV MEMORY="-server -XX:+UseG1GC -XX:+UseContainerSupport"
ENV CATALINA_OPTS="$MEMORY"
RUN apk add --update --no-cache --virtual curl builddeps unzip bash && apk upgrade --update --no-cache \
&& rm -rf $CATALINA_HOME/webapps/* \
&& if [ -z "$VERSION" ] ; then VERSION="$(curl -i -o - --silent https://api.github.com/repos/OpenIdentityPlatform/OpenIG/releases/latest | grep -m1 "\"name\"" | cut -d\" -f4)"; fi \
&& curl -L https://github.com/OpenIdentityPlatform/OpenIG/releases/download/$VERSION/OpenIG-$VERSION.war --output $CATALINA_HOME/webapps/ROOT.war \
&& adduser -S -u 1001 -G root $OPENIG_USER \
&& install -d -o $OPENIG_USER $OPENIG_BASE \
&& chown -R $OPENIG_USER $CATALINA_HOME \
&& chgrp -R 0 $CATALINA_HOME \
&& chmod -R g=u $CATALINA_HOME \
&& chgrp -R 0 $OPENIG_BASE \
&& chmod -R g=u $OPENIG_BASE \
&& apk del unzip && rm -rf /var/cache/apk/* \
&& sed -i '/<\/Host>/i \ \ \ \ <Valve className=\"org.apache.catalina.valves.RemoteIpValve\" httpServerPort=\"8080\" httpsServerPort=\"443\" />' $CATALINA_HOME/conf/server.xml
USER $OPENIG_USER
EXPOSE 8080/tcp
HEALTHCHECK --interval=30s --timeout=30s --start-period=1s --retries=3 CMD curl -v -L --fail http://localhost:8080/openig/ || exit 1
CMD ["/usr/local/tomcat/bin/catalina.sh", "run"]