From 3728c5254e3f9c34db7c480d79f44f23c121dd01 Mon Sep 17 00:00:00 2001 From: Larry Price Date: Mon, 23 Feb 2015 13:22:18 -0500 Subject: [PATCH] initial commit --- Dockerfile | 35 +++++++++++++++++++++++++++++++++++ bin/init | 10 ++++++++++ bin/start-apache2 | 4 ++++ conf/config.inc.php | 23 +++++++++++++++++++++++ conf/supervisord.conf | 9 +++++++++ 5 files changed, 81 insertions(+) create mode 100644 Dockerfile create mode 100755 bin/init create mode 100755 bin/start-apache2 create mode 100644 conf/config.inc.php create mode 100644 conf/supervisord.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3b901da --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM debian:jessie + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update +RUN apt-get install git -y --force-yes +RUN apt-get install postgresql -y --force-yes +RUN apt-get install sendmail sendmail-bin -y --force-yes +RUN apt-get install wkhtmltopdf -y --force-yes +RUN apt-get install supervisor -y --force-yes +RUN apt-get install apache2 -y --force-yes +RUN apt-get install libapache2-mod-php5 -y --force-yes +RUN apt-get install php-gettext -y --force-yes +RUN apt-get install gettext -y --force-yes +RUN apt-get install php5-pgsql -y --force-yes + +RUN service postgresql start + +RUN git clone https://github.com/francoisjacquet/rosariosis.git /usr/src/rosariosis + +WORKDIR /usr/src/rosariosis +RUN git checkout -b 2.7.4 + +RUN rm -rf /var/www/html && mkdir -p /var/www && ln -s /usr/src/rosariosis/ /var/www/html && chmod 777 /var/www/html + +ADD bin/init /init +ADD bin/start-apache2 /start-apache2 +ADD conf/supervisord.conf /etc/supervisor/conf.d/supervisord.conf +ADD conf/config.inc.php /usr/src/rosariosis/config.inc.php + +RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf + +EXPOSE 80 + +ENTRYPOINT [ "/init" ] diff --git a/bin/init b/bin/init new file mode 100755 index 0000000..da50f32 --- /dev/null +++ b/bin/init @@ -0,0 +1,10 @@ +#!/bin/bash + +DB_EXISTS=`psql -U postgres -h $ROSARIODB_PORT_5432_TCP_ADDR -p $ROSARIODB_PORT_5432_TCP_PORT -l | grep rosariosis | wc -l` + +if [ "$DB_EXISTS" -eq "0" ]; then + psql -U postgres -h $ROSARIODB_PORT_5432_TCP_ADDR -p $ROSARIODB_PORT_5432_TCP_PORT -c "CREATE DATABASE rosariosis WITH ENCODING 'UTF8' TEMPLATE template1" + psql -U postgres -h $ROSARIODB_PORT_5432_TCP_ADDR -p $ROSARIODB_PORT_5432_TCP_PORT rosariosis < rosariosis.sql +fi + +/usr/bin/supervisord diff --git a/bin/start-apache2 b/bin/start-apache2 new file mode 100755 index 0000000..7d9c707 --- /dev/null +++ b/bin/start-apache2 @@ -0,0 +1,4 @@ +#!/bin/bash + +source /etc/apache2/envvars +exec apache2ctl -D FOREGROUND diff --git a/conf/config.inc.php b/conf/config.inc.php new file mode 100644 index 0000000..09fe42e --- /dev/null +++ b/conf/config.inc.php @@ -0,0 +1,23 @@ + diff --git a/conf/supervisord.conf b/conf/supervisord.conf new file mode 100644 index 0000000..0ee63e7 --- /dev/null +++ b/conf/supervisord.conf @@ -0,0 +1,9 @@ +[supervisord] +nodaemon=true + +[program:apache2] +command=/start-apache2 +numprocs=1 +autostart=true +autorestart=true +