1 FROM openresty/openresty:alpine
3 MAINTAINER "Guangrong Fu" <fu.guangrong@zte.com.cn>
7 ENV HOSTNAME=holmes-rule-mgmt \
9 JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk \
10 PATH=$PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin \
11 JAVA_ALPINE_VERSION=8.242.08-r0 \
14 #add the backend package to the docker image
16 ADD holmes-rulemgt-standalone-*-linux64.tar.gz /home/holmes/
18 #RUN mkdir /etc/ssl/private
19 ADD holmes-rulemgt-frontend-*.tar.gz /usr/local/openresty/nginx/html/
20 ADD nginx-https.conf /usr/local/openresty/nginx/conf
21 ADD nginx-http.conf /usr/local/openresty/nginx/conf
22 ADD holmes-frontend.key /etc/ssl/private
23 ADD holmes-frontend-selfsigned.crt /etc/ssl/certs
24 ADD dhparam.pem /etc/ssl/certs
26 #install java-1.8-openjdk
28 # add a simple script that can auto-detect the appropriate JAVA_HOME value
29 # based on whether the JDK or only the JRE is installed
34 echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
35 } > /usr/local/bin/docker-java-home \
36 && chmod +x /usr/local/bin/docker-java-home \
40 && apk add --no-cache openjdk8="$JAVA_ALPINE_VERSION" \
41 && [ "$JAVA_HOME" = "$(docker-java-home)" ] \
42 #install neccessary tools
43 && apk add --no-cache curl \
44 && apk add --no-cache postgresql-client="$PG_VERSION" \
45 && apk add --no-cache nss \
46 #add the frontend pacakge to the docker images
47 && rm /etc/nginx/conf.d/default.conf \
48 && chmod -R 777 /usr/local/openresty/nginx/ \
49 #switch the user to holmes
50 && addgroup -S holmes && adduser -S -G holmes holmes \
51 && chmod -R a+rw /home/holmes/ \
52 && chmod -R a+rw /var/log/ \
53 && chmod 755 /home/holmes/bin/*.sh
56 CMD ["sh", "/home/holmes/bin/run.sh"]