initial commit

This commit is contained in:
Larry Price 2015-02-23 13:22:18 -05:00
commit 3728c5254e
5 changed files with 81 additions and 0 deletions

35
Dockerfile Normal file
View File

@ -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" ]

10
bin/init Executable file
View File

@ -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

4
bin/start-apache2 Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
source /etc/apache2/envvars
exec apache2ctl -D FOREGROUND

23
conf/config.inc.php Normal file
View File

@ -0,0 +1,23 @@
<?php
if(!defined('CONFIG_INC'))
{
define('CONFIG_INC',1);
// PostgreSQL Database Setup
$DatabaseServer = getenv('ROSARIODB_PORT_5432_TCP_ADDR');
$DatabaseUsername = 'postgres';
// $DatabasePassword = '';
$DatabaseName = 'rosariosis';
$DatabasePort = getenv('ROSARIODB_PORT_5432_TCP_PORT');
// Server Names and Paths
$RosarioPath = dirname(__FILE__).'/';
$pg_dumpPath = '/usr/bin/pg_dump'; // Specify the path to the database dump utility for this server.
$wkhtmltopdfPath = '/usr/bin/wkhtmltopdf'; // empty string means wkhtmltopdf will not be called and reports will be rendered in html instead of pdf
$DefaultSyear = '2014'; // Default school year, should match the database to be able to login
$RosarioNotifyAddress = ''; // email address to send error and new administrator notifications
$RosarioLocales = array('en_US.utf8'); // Add other languages you want to support here, ex: array('en_US.utf8', 'fr_FR.utf8', 'es_ES.utf8');
}
?>

9
conf/supervisord.conf Normal file
View File

@ -0,0 +1,9 @@
[supervisord]
nodaemon=true
[program:apache2]
command=/start-apache2
numprocs=1
autostart=true
autorestart=true