Commit 75eee141 authored by Luca Cinquini's avatar Luca Cinquini
Browse files

Making idp-node wait for postgres

parent 6565f06c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -15,4 +15,6 @@ RUN cd /usr/local/tomcat/webapps/esgf-idp/ && \
    rm esgf-idp.war && \
    chown -R tomcat:tomcat /usr/local/tomcat/webapps/esgf-idp

# Note: Tomcat startup configuration is inherited from esgf-tomcat container
# Override Tomcat startup to wait for Postgred connection to be ready
COPY scripts/wait_for_postgres.sh /usr/local/bin/wait_for_postgres.sh
COPY conf/supervisord.tomcat.conf /etc/supervisor/conf.d/supervisord.tomcat.conf 
+11 −0
Original line number Diff line number Diff line
[program:tomcat]
command=sh -c "/usr/local/bin/wait_for_postgres.sh && %(ENV_CATALINA_HOME)s/bin/catalina.sh run"
process_name=%(program_name)s
startsecs=5
stopsignal=INT
user=tomcat
#stdout_logfile=%(ENV_CATALINA_HOME)s/logs/catalina.out
#stderr_logfile=%(ENV_CATALINA_HOME)s/logs/catalina.err
stdout_logfile=/dev/stdout
redirect_stderr=true
stdout_logfile_maxbytes=0
+0 −6
Original line number Diff line number Diff line
#!/bin/sh
# script that starts Tomcat then keeps the container running
#
/usr/local/tomcat/bin/catalina.sh start
#
tail -f /dev/null
+2 −3
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ FROM esgfhub/esgf-node:1.2
MAINTAINER Luca Cinquini <luca.cinquini@jpl.nasa.gov>

# Tomcat 8
ENV TOMCAT_VERSION 8.5.16
ENV TOMCAT_VERSION 8.5.20

RUN wget -O /tmp/apache-tomcat-${TOMCAT_VERSION}.tar.gz http://mirror.reverse.net/pub/apache/tomcat/tomcat-8/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz && \
    cd /usr/local && tar xzf /tmp/apache-tomcat-${TOMCAT_VERSION}.tar.gz && \
@@ -40,5 +40,4 @@ EXPOSE 8443

# startup
COPY conf/supervisord.tomcat.conf /etc/supervisor/conf.d/supervisord.tomcat.conf
COPY scripts/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["supervisord", "--nodaemon", "-c", "/etc/supervisord.conf"]