Fixed the c3p0 issue found by NexusIQ
[holmes/rule-management.git] / rulemgt-standalone / src / main / assembly / Dockerfile
1 FROM openresty/openresty:alpine
2
3 MAINTAINER "Guangrong Fu" <fu.guangrong@zte.com.cn>
4
5 EXPOSE 9101 9104 9105 9201
6
7 ENV HOSTNAME holmes-rule-mgmt
8
9 ENV LANG C.UTF-8
10
11 #install java-1.8-openjdk
12
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
15 RUN { \
16                 echo '#!/bin/sh'; \
17                 echo 'set -e'; \
18                 echo; \
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
24
25 ENV JAVA_ALPINE_VERSION 8.191.12-r0
26
27 RUN set -x \
28         && apk add --no-cache \
29                 openjdk8="$JAVA_ALPINE_VERSION" \
30         && [ "$JAVA_HOME" = "$(docker-java-home)" ]
31
32 #install neccessary tools
33 RUN apk upgrade \
34     && apk update \
35     && apk add --no-cache curl \
36     && apk add --no-cache postgresql-client=10.5-r0
37
38
39
40 #add the frontend pacakge to the docker images
41 RUN rm /etc/nginx/conf.d/default.conf
42 RUN mkdir -p /etc/ssl/certs/
43 RUN mkdir /etc/ssl/private
44 ADD holmes-rulemgt-frontend-*.tar.gz /usr/local/openresty/nginx/html/
45 ADD nginx.conf /usr/local/openresty/nginx/conf
46 ADD holmes-frontend.key /etc/ssl/private
47 ADD holmes-frontend-selfsigned.crt /etc/ssl/certs
48 ADD dhparam.pem /etc/ssl/certs
49
50 #switch the user to holmes
51 RUN addgroup -S holmes && adduser -S -G holmes holmes
52
53 #add the backend package to the docker image
54 WORKDIR /home/holmes
55 ADD holmes-rulemgt-standalone-*-linux64.tar.gz /home/holmes/
56 RUN chmod -R a+rw /home/holmes/
57 RUN chmod -R a+rw /var/log/
58 RUN chmod 755 /home/holmes/bin/*.sh
59
60 USER holmes
61 CMD ["sh", "/home/holmes/bin/run.sh"]
62