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