Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 34 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@

FROM phusion/baseimage
MAINTAINER gabriel schubiner <gabriel.schubiner@gmail.com>
MAINTAINER Starchy Grant <starchy@gmail.com>

# Installation
RUN apt-get update && apt-get install -y --no-install-recommends \
apache2 \
libapache2-mod-php5 \
libapache2-mod-php \
build-essential \
php5 \
php5-dev \
php5-mysqlnd \
php5-imap \
php5-cli \
php \
php-dev \
php-mysqlnd \
php-imap \
php-cli \
php-pear \
php-apc \
php5-gd \
php5-memcached \
php-apcu \
php-gd \
php-memcached \
python-pip \
mysql-client \
ssmtp \
memcached
memcached \
drush \
git

# Cron
ADD ./assets/openatrium.cron.sh /etc/cron.hourly/openatrium
RUN chmod +x /etc/cron.hourly/openatrium

# Apache Cfg
ADD assets/apache.security.conf /etc/apache2/conf.d/
RUN rm -f /etc/apache2/sites-enabled/*
ADD assets/apache.openatrium.conf /etc/apache2/sites-available/
RUN ln -s /etc/apache2/sites-available/apache.openatrium.conf /etc/apache2/sites-enabled/openatrium.conf
RUN a2enmod rewrite

# Symlink for drush
RUN mkdir /usr/local/drush
RUN ln -s /usr/bin/drush /usr/local/drush/drush

# PHP Config
ENV PHP_MEMORY_LIMIT 1024M
ENV PHP_MAX_EXECUTION_TIME 900
Expand All @@ -39,14 +45,22 @@ ENV PHP_SENDMAIL_PATH /usr/sbin/ssmtp -t
RUN sed -i \
-e 's/^;session.save_path/session.save_path/g' \
-e "s!^;sendmail_path =.*\$!sendmail_path = $PHP_SENDMAIL_PATH!g" \
/etc/php5/apache2/php.ini
/etc/php/7.0/apache2/php.ini
ADD ./assets/update_php_vars.sh /usr/bin/
RUN chmod +x /usr/bin/update_php_vars.sh
RUN update_php_vars.sh
RUN php5enmod imap
RUN pecl install -Z uploadprogress && \
echo 'extension=uploadprogress.so' >/etc/php5/mods-available/uploadprogress.ini && \
php5enmod uploadprogress
RUN phpenmod imap
RUN cd /root \
&& git clone https://github.com/Jan-E/uploadprogress.git \
&& cd uploadprogress \
&& phpize \
&& ./configure \
&& make \
&& make install \
&& echo 'extension=uploadprogress.so' >/etc/php/7.0/mods-available/uploadprogress.ini \
&& phpenmod uploadprogress \
&& cd \
&& rm -rf /root/uploadprogress

# Default ENV vars
## Apache
Expand Down Expand Up @@ -91,16 +105,12 @@ ENV SSMTP_AUTH_METHOD LOGIN
ADD ./assets/update_ssmtp.sh /usr/bin/update_ssmtp.sh
RUN rm -f /etc/ssmtp/ssmtp.conf
ADD ./assets/ssmtp.conf /etc/ssmtp/ssmtp.conf
RUN chmod +x /usr/bin/update_ssmtp.sh && update_ssmtp.sh

# Drush install
RUN pear channel-discover pear.drush.org

RUN pear install drush/drush
RUN chmod +x /usr/bin/update_ssmtp.sh
RUN /usr/bin/update_ssmtp.sh

# Open Atrium
RUN rm -f /var/www/html/*
RUN curl http://ftp.drupal.org/files/projects/openatrium-7.x-2.33-core.tar.gz | tar xz -C /var/www/html --strip-components=1
RUN curl https://ftp.drupal.org/files/projects/openatrium-7.x-2.618-core.tar.gz | tar xz -C /var/www/html --strip-components=1

# Services
RUN mkdir /etc/service/memcached /etc/service/apache
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This repo contains a working repository for Phase2's OpenAtrium, based on the Drupal CMS.

## OpenAtrium - ver. 2.30RC3
## OpenAtrium - ver. 2.618

OpenAtrium is a pretty rad Drupal distribution, supported by Phase2, that makes it pretty easy to set up very flexible intranets/community sites with out-of-the-box support for maintaining a hierarchy of 'spaces' that can each be customized with calendars, tasks, discussion boards, and file sharing. User groups, teams, permissions, etc. all well supported.

Expand Down Expand Up @@ -177,11 +177,11 @@ Last Note: 99% of this image is relevant to any Drupal 7 distribution, so if you

You'll want to change this line:

`RUN curl http://ftp.drupal.org/files/projects/openatrium-7.x-2.30-core.tar.gz | tar xz -C /var/www/html --strip-components=1 `
`RUN curl https://ftp.drupal.org/files/projects/openatrium-7.x-2.618-core.tar.gz | tar xz -C /var/www/html --strip-components=1 `

to

`RUN curl http://ftp.drupal.org/files/projects/<distribution_name>-7.x-<distribution_version>-core.tar.gz | tar xz -C /var/www/html --strip-components=1 `
`RUN curl https://ftp.drupal.org/files/projects/<distribution_name>-7.x-<distribution_version>-core.tar.gz | tar xz -C /var/www/html --strip-components=1 `

I should probably take this piece out into the init.sh script, and make the distribution name and version specifiable by environment variables, so you could literally use this image for any Drupal 7 distribution without rebuilding it, but maybe later.

Expand Down
3 changes: 3 additions & 0 deletions assets/apache.security.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ServerTokens Prod
ServerSignature Off
TraceEnable Off
1 change: 1 addition & 0 deletions assets/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function restore_permissions {

pushd sites
find . -type d -name files -exec chmod 770 '{}' \;
find ./default/files -type d -exec chown -R www-data '{}' \;
find ./default/files -type d -exec chmod 770 '{}' \;
find ./default/files -type f -exec chmod 660 '{}' \;

Expand Down
7 changes: 4 additions & 3 deletions assets/update_php_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@


sed -i \
-e "s/^expose_php.*\$/expose_php = Off/g" \
-e "s/^memory_limit.*\$/memory_limit = $PHP_MEMORY_LIMIT/g" \
-e "s/^max_execution_time.*\$/max_execution_time = $PHP_MAX_EXECUTION_TIME/g" \
-e "s/^session.save_handler.*\$/session.save_handler = $PHP_SESSION_SAVE_CACHE/g" \
-e "s!^sendmail_path.*\$!sendmail_path = $PHP_SENDMAIL_PATH!g" \
/etc/php5/apache2/php.ini
/etc/php/7.0/apache2/php.ini

if [ "$PHP_SESSION_SAVE_CACHE" == "memcached" ]; then
sed -i -e "s!^session.save_path.*\$!session.save_path = \"localhost:11211\"!g" /etc/php5/apache2/php.ini
sed -i -e "s!^session.save_path.*\$!session.save_path = \"localhost:11211\"!g" /etc/php/7.0/apache2/php.ini
else
sed -i -e "s!^session.save_path.*\$!session.save_path = \"/var/lib/php5\"!g" /etc/php5/apache2/php.ini
sed -i -e "s!^session.save_path.*\$!session.save_path = \"/var/lib/php\"!g" /etc/php/7.0/apache2/php.ini
fi
26 changes: 26 additions & 0 deletions docker-compose.yml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
openatrium:
image: starchy/openatrium # not currently on dockerhub
links:
- mariadb
environment:
DB_NAME: openatrium
INSTALL_SITE: "false" # set to true for automatic install on first run only
MIGRATE_SITES_TO: /sites
volumes:
- ./sites:/sites
- ./ssmtp.conf:/etc/ssmtp/ssmtp.conf:ro
ports:
- "80:80"
restart: always

mariadb:
image: mariadb:10.2
environment:
MYSQL_DATABASE: openatrium
MYSQL_USER: openatrium
MYSQL_PASSWORD: changeme
MYSQL_ROOT_PASSWORD: changemetoo
volumes:
- ./mysql:/var/lib/mysql
restart: always