Commit f2d9c9af authored by Luca Cinquini's avatar Luca Cinquini
Browse files

Working on standardizing container startup.

parent 0b36e1c2
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -26,15 +26,18 @@ RUN mkdir -p /var/www/.python-eggs && \
# configuration for standalone service
# (overridden by ESGF settings when running with docker-compose from parent directory)
COPY certs/ /etc/certs/
COPY conf/ /etc/httpd/conf.d/
COPY html/ /var/www/html/
COPY conf/httpd.conf /etc/httpd/conf.d/httpd.conf
COPY conf/ssl.conf /etc/httpd/conf.d/ssl.conf

EXPOSE 80 443

# startup configuration
ADD conf/apache.conf /etc/supervisor/conf.d/apache.conf
ADD scripts/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh

# start httpd server
# parent process runs as 'root' to access port 80 and configuration files,
# but it does NOT serve client requests
# the child processes that serve user requests run as user 'apache'
ENTRYPOINT ["apachectl", "-D", "FOREGROUND"]
ENTRYPOINT /usr/local/bin/docker-entrypoint.sh

httpd/conf/apache.conf

0 → 100644
+5 −0
Original line number Diff line number Diff line
[program:httpd]
command=apachectl -D FOREGROUND
redirect_stderr=true
killasgroup=true
stopasgroup=true
+5 −4
Original line number Diff line number Diff line
#!/bin/bash
# script to start httpd as part of ESGF services
# Script to start apache httpd as part of ESGF services

# change CoG directory permission
chown -R apache:apache /usr/local/cog
@@ -8,8 +8,9 @@ chown -R apache:apache /usr/local/cog
rm -f /etc/httpd/conf.d/ssl.conf
rm -f /etc/httpd/conf.d/welcome.conf

# start httpd service
service httpd restart
# start supervisor --> httpd service
supervisord -c /etc/supervisord.conf

# keep container running
# keep container running by printing log to standard out
sleep 2
tail -f /etc/httpd/logs/error_log
+4 −2
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ RUN pip install --use-wheel Pillow==${PILLOW_VERSION}
# executable: /usr/local/bin/supervisord
# default supervisor configuration /etc/supervisord.conf :
# will look for additional service configurations in /etc/supervisor/conf.d/
# log file (from configuration): /tmp/supervisord.log
RUN pip install supervisor
COPY conf/supervisord.conf /etc/supervisord.conf
RUN mkdir -p /etc/supervisor/conf.d/
@@ -92,5 +93,6 @@ RUN mkdir -p /esg/content
# necessary to locate /esg/config/esgf.properties
ENV ESGF_HOME /esg

# start supervisor in non-daemon mode
#ENTRYPOINT ["supervisord", "--nodaemon", "-c", "/etc/supervisord.conf"]
# default entrypoint starts supervisor in non-daemon mode
# to be overridden by child images
ENTRYPOINT ["supervisord", "--nodaemon", "-c", "/etc/supervisord.conf"]
+0 −1
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
file=/tmp/supervisor.sock

[supervisord]
nodaemon=true
logfile=/tmp/supervisord.log
pidfile=/tmp/supervisord.pid
 
Loading