1 FROM openresty/openresty:alpine
3 MAINTAINER "Guangrong Fu" <fu.guangrong@zte.com.cn>
7 ENV HOSTNAME holmes-rule-mgmt
11 #install java-1.8-openjdk
13 # add a simple script that can auto-detect the appropriate JAVA_HOME value
14 # based on whether the JDK or only the JRE is installed
19 echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
20 } > /usr/local/bin/docker-java-home \
21 && chmod +x /usr/local/bin/docker-java-home
22 ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
23 ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
25 ENV JAVA_ALPINE_VERSION 8.171.11-r0
28 && apk add --no-cache \
29 openjdk8="$JAVA_ALPINE_VERSION" \
30 && [ "$JAVA_HOME" = "$(docker-java-home)" ]
32 #install neccessary tools
35 && apk add --no-cache curl \
36 && apk add --no-cache postgresql-client=10.4-r0
38 #add the frontend pacakge to the docker images
39 RUN rm /etc/nginx/conf.d/default.conf
40 ADD holmes-rulemgt-frontend-*.tar.gz /usr/local/openresty/nginx/html
41 ADD nginx.conf /usr/local/openresty/nginx/conf
43 #add the backend package to the docker image
44 RUN mkdir /home/holmes
46 ADD holmes-rulemgt-standalone-*-linux64.tar.gz /home/holmes/
47 RUN chmod 755 /home/holmes/bin/*.sh
49 CMD ["sh", "/home/holmes/bin/run.sh"]