2 MAINTAINER "Lu Ji" <lu.ji3@zte.com.cn>
4 # Expose the Usecase-UI backend port and postgreSQL port
9 ENV PG_HOME=/etc/postgresql \
11 PG_VAR_LIB=/var/lib/postgresql \
12 PG_USR_LIB=/usr/lib/postgresql \
13 PG_LOGDIR=/var/log/postgresql
15 # Add the PostgreSQL PGP key to verify their Debian packages
16 RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
17 # Add PostgreSQL's repository
18 RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
20 # Update the Ubuntu and install tools
21 RUN apt-get update && \
22 apt-get install -y openjdk-8-jdk && \
23 apt-get install -y gcc && \
24 apt-get install -y curl && \
25 apt-get install -y vim && \
26 apt-get install -y build-essential && \
27 apt-get install -y libssl-dev && \
28 apt-get install -y libffi-dev && \
29 apt-get -y -q install postgresql-${PG_VERSION} postgresql-client-${PG_VERSION} postgresql-contrib-${PG_VERSION}
31 # Adjust PostgreSQL configuration
32 RUN echo "host all all 0.0.0.0/0 md5" >> ${PG_HOME}/${PG_VERSION}/main/pg_hba.conf
33 RUN echo "listen_addresses='*'" >> ${PG_HOME}/${PG_VERSION}/main/postgresql.conf
35 # Add VOLUMEs to allow backup of config, logs and databases
36 VOLUME ["${PG_HOME}", "${PG_VAR_LIB}", "${PG_LOGDIR}"]
38 # Set the default command to run postgreSQL when starting the container
39 # CMD ["${PG_USR_LIB}/${PG_VERSION}/bin/postgres", "-D", "${PG_VAR_LIB}/${PG_VERSION}/main", "-c", "config_file=${PG_HOME}/${PG_VERSION}/main/postgresql.conf"]
42 RUN sed -i 's|#networkaddress.cache.ttl=-1|networkaddress.cache.ttl=10|' /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security
43 ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
44 ENV PATH $PATH:/usr/lib/jvm/java-8-openjdk-amd64/jre/bin:/usr/lib/jvm/java-8-openjdk-amd64/bin
45 ENV CLASSPATH .:${JAVA_HOME}/lib:${JRE_HOME}/lib
46 ENV JRE_HOME ${JAVA_HOME}/jre
48 #Add Usecase-UI server related resources to the docker image
51 ADD usecase-ui-server-*-linux64.tar.gz /home/uui/
53 ENTRYPOINT /home/uui/bin/run.sh