Permalink
Browse files

Create Dockerfile for development environment. Update bootstrap shell…

… scripts to support this.
  • Loading branch information...
robmyers committed Apr 9, 2015
1 parent 523230b commit f495615e7614a5d59211d8263baa694c2220874c
Showing with 58 additions and 10 deletions.
  1. +43 −0 Dockerfile
  2. +6 −0 config/apache.conf
  3. +2 −0 config/required_packages.txt
  4. +2 −2 docroot/wp-config-local.php.in
  5. +5 −8 scripts/bootstrap_server_ubuntu.sh
View
@@ -0,0 +1,43 @@
FROM ubuntu:14.04
MAINTAINER Rob Myers <rob@robmyers.org>
# We specify a host name for the template used to create the virtual host
# Add an entry to /etc/hosts to point this to the container's IP
ENV WWWNAME creativecommons.docker
ENV DBNAME wordpress
ENV DBUSER dbuser
ENV DBPASS ""
# So we can install mysql-server with no root password without prompting
ENV DEBIAN_FRONTEND noninteractive
# Allow services to be restarted
RUN perl -i -p -e "s/exit 101/exit 0/" /usr/sbin/policy-rc.d
# Copy in to /var/www so it's somewhere a) findable and b) web accessible
ADD . /var/www/creativecommons.org/
WORKDIR /var/www/creativecommons.org/python_env/bin
# Remove any virtualenv setup (files and symlinks) copied from the environment
# This cleans up from if we ran bootstrap_checkout.sh before
RUN find ! -name ccengine.fcgi.in ! -type d -exec rm -f {} +
WORKDIR /var/www/creativecommons.org
RUN scripts/bootstrap_server_ubuntu.sh \
"$WWWNAME" "$DBNAME" "$DBUSER" "$DBPASS"
RUN scripts/bootstrap_checkout.sh \
"$WWWNAME" "$DBNAME" "$DBUSER" "$DBPASS"
# Clear this, as setting DEBIAN_FRONTEND is so bad it's in the Docker FAQ
ENV DEBIAN_FRONTEND ""
EXPOSE 80
# Do more than one thing in the container. This is just for testing
CMD /etc/init.d/mysql start && /usr/sbin/apache2ctl -D FOREGROUND
# Now import or create a database, then commit
View
@@ -86,6 +86,12 @@
# License engine and legalcode
#----------
<Directory "${dir}/python_env/bin/">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
Alias /ccengine-fcgi ${dir}/python_env/bin/ccengine.fcgi
Alias /cc.engine-cache ${dir}/python_env/cache
@@ -1,8 +1,10 @@
git
apache2
python-virtualenv
python-pip
gcc
python-dev
zlib1g-dev
libxml2
libxml2-dev
libxslt1.1
@@ -7,7 +7,7 @@ define('DB_NAME', '@dbname@');
define('DB_USER', '@dbuser@');
define('DB_PASSWORD', '@dbpass@');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'iso-8859-1');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
define('AUTH_KEY', 'replace with random, secret phrases / strings');
@@ -27,4 +27,4 @@ if (WP_DEBUG) {
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
define('SCRIPT_DEBUG', true);
}
}
@@ -26,16 +26,13 @@ fi
# 1. Copy config files into place
if grep -q "apache.conf" /etc/apache2/httpd.conf
then
echo "Note: /etc/apache2/httpd.conf seems to be loading an apache.conf file,"
echo "leaving it alone. If that's not the CC apache.conf file, then you'll"
echo "need to add the Include line manually."
else
echo "Include ${TOPDIR}/config/apache.conf" >> /etc/apache2/httpd.conf
if [ ! -f /etc/apache2/conf-available/creativecommons-template.conf ]; then
cp ${TOPDIR}/config/apache.conf \
/etc/apache2/conf-available/creativecommons-template.conf
a2enconf creativecommons-template
fi
cat <<EOF > /etc/apache2/sites-available/${HOSTNAME}
cat <<EOF > /etc/apache2/sites-available/${HOSTNAME}.conf
<VirtualHost *:80>
Use CCVHost ${HOSTNAME} http ${TOPDIR} /var/log/apache2/${HOSTNAME}
</VirtualHost>

0 comments on commit f495615

Please sign in to comment.