From e9a3f48e812251c94d606da40ee9e4fcdc9a1a0a Mon Sep 17 00:00:00 2001 From: mnshantz <mnshantz@uwaterloo.ca> Date: Mon, 4 Feb 2019 13:09:12 -0500 Subject: [PATCH] Updated files to use wcms-docker instead of localhost. --- .env | 2 +- build-scripts/drupal7/000-default.conf | 6 +-- build-scripts/drupal7/Dockerfile | 49 ++++++++++--------- build-scripts/drupal7/docker-entrypoint-d7.sh | 4 +- build-scripts/drupal7/settings.conf | 8 +-- build-scripts/drupal8/000-default.conf | 6 +-- build-scripts/drupal8/docker-entrypoint.sh | 2 +- 7 files changed, 39 insertions(+), 38 deletions(-) diff --git a/.env b/.env index 135ac1e..cda9f4d 100644 --- a/.env +++ b/.env @@ -7,7 +7,7 @@ ################################# PROJECT_NAME=wcms-docker -PROJECT_BASE_URL=wcms.localhost +PROJECT_BASE_URL=wcms-docker ### Database Settings ### diff --git a/build-scripts/drupal7/000-default.conf b/build-scripts/drupal7/000-default.conf index 2f50054..97ecf31 100644 --- a/build-scripts/drupal7/000-default.conf +++ b/build-scripts/drupal7/000-default.conf @@ -1,8 +1,8 @@ <VirtualHost *:80> DocumentRoot /var/www/drupal7 ServerAdmin webmaster@localhost - ServerName localhost - Redirect permanent / https://localhost/ + ServerName wcms-docker + Redirect permanent / https://wcms-docker/ <Directory /> Options FollowSymLinks AllowOverride None @@ -17,7 +17,7 @@ <VirtualHost *:443> ServerAdmin webmaster@localhost DocumentRoot /var/www/drupal7 - ServerName localhost + ServerName wcms-docker <Directory /> Options FollowSymLinks AllowOverride None diff --git a/build-scripts/drupal7/Dockerfile b/build-scripts/drupal7/Dockerfile index 87eb853..583ac47 100644 --- a/build-scripts/drupal7/Dockerfile +++ b/build-scripts/drupal7/Dockerfile @@ -2,6 +2,7 @@ # Dockerfile to build WCMS container images # Based on Ubuntu ############################################################ + # Set the base image to Ubuntu FROM ubuntu:xenial @@ -148,36 +149,36 @@ RUN cd /var/www/drupal7 && \ ln -s . fdsu4 ## Create site folders for drupal multi-site -RUN mkdir /var/www/drupal7/sites/localhost.fdsu1 -RUN mkdir /var/www/drupal7/sites/localhost.fdsu2 -RUN mkdir /var/www/drupal7/sites/localhost.fdsu3 -RUN mkdir /var/www/drupal7/sites/localhost.fdsu4 +RUN mkdir /var/www/drupal7/sites/wcms-docker.fdsu1 +RUN mkdir /var/www/drupal7/sites/wcms-docker.fdsu2 +RUN mkdir /var/www/drupal7/sites/wcms-docker.fdsu3 +RUN mkdir /var/www/drupal7/sites/wcms-docker.fdsu4 ## Add module and file folders as well as copy the settings.php over for each site -RUN mkdir /var/www/drupal7/sites/localhost.fdsu1/files -RUN mkdir /var/www/drupal7/sites/localhost.fdsu1/modules +RUN mkdir /var/www/drupal7/sites/wcms-docker.fdsu1/files +RUN mkdir /var/www/drupal7/sites/wcms-docker.fdsu1/modules ## Create settings.php file -COPY settings.conf /var/www/drupal7/sites/localhost.fdsu1/settings.php -RUN mkdir /var/www/drupal7/sites/localhost.fdsu2/files -RUN mkdir /var/www/drupal7/sites/localhost.fdsu2/modules +COPY settings.conf /var/www/drupal7/sites/wcms-docker.fdsu1/settings.php +RUN mkdir /var/www/drupal7/sites/wcms-docker.fdsu2/files +RUN mkdir /var/www/drupal7/sites/wcms-docker.fdsu2/modules ## Create settings.php file -COPY settings.conf /var/www/drupal7/sites/localhost.fdsu2/settings.php -RUN mkdir /var/www/drupal7/sites/localhost.fdsu3/files -RUN mkdir /var/www/drupal7/sites/localhost.fdsu3/modules +COPY settings.conf /var/www/drupal7/sites/wcms-docker.fdsu2/settings.php +RUN mkdir /var/www/drupal7/sites/wcms-docker.fdsu3/files +RUN mkdir /var/www/drupal7/sites/wcms-docker.fdsu3/modules ## Create settings.php file COPY settings.conf /var/www/drupal7/sites/d7.fdsu3/settings.php -RUN mkdir /var/www/drupal7/sites/localhost.fdsu4/files -RUN mkdir /var/www/drupal7/sites/localhost.fdsu4/modules +RUN mkdir /var/www/drupal7/sites/wcms-docker.fdsu4/files +RUN mkdir /var/www/drupal7/sites/wcms-docker.fdsu4/modules ## Create settings.php file -COPY settings.conf /var/www/drupal7/sites/localhost.fdsu1/settings.php -COPY settings.conf /var/www/drupal7/sites/localhost.fdsu2/settings.php -RUN cd /var/www/drupal7/sites/localhost.fdsu2 && \ +COPY settings.conf /var/www/drupal7/sites/wcms-docker.fdsu1/settings.php +COPY settings.conf /var/www/drupal7/sites/wcms-docker.fdsu2/settings.php +RUN cd /var/www/drupal7/sites/wcms-docker.fdsu2 && \ sed -i 's/fdsu1/fdsu2/g' settings.php -COPY settings.conf /var/www/drupal7/sites/localhost.fdsu3/settings.php -RUN cd /var/www/drupal7/sites/localhost.fdsu3 && \ +COPY settings.conf /var/www/drupal7/sites/wcms-docker.fdsu3/settings.php +RUN cd /var/www/drupal7/sites/wcms-docker.fdsu3 && \ sed -i 's/fdsu1/fdsu3/g' settings.php -COPY settings.conf /var/www/drupal7/sites/localhost.fdsu4/settings.php -RUN cd /var/www/drupal7/sites/localhost.fdsu4 && \ +COPY settings.conf /var/www/drupal7/sites/wcms-docker.fdsu4/settings.php +RUN cd /var/www/drupal7/sites/wcms-docker.fdsu4 && \ sed -i 's/fdsu1/fdsu4/g' settings.php ## Get the base profile from git @@ -185,11 +186,11 @@ RUN git clone https://git.uwaterloo.ca/wcms/uw_base_profile.git /var/www/drupal7 RUN chown -R vagrant:www-data /var/www/drupal7/profiles/uw_base_profile RUN chmod -R g+w /var/www/drupal7/profiles/uw_base_profile ## Rebuild the profile to get the latest modules -RUN ls /var/www/drupal7/profiles/uw_base_profile -RUN /var/www/drupal7/profiles/uw_base_profile/rebuild.sh +#RUN cd /var/www/drupal7/profiles/uw_base_profile +#RUN /var/www/drupal7/profiles/uw_base_profile/rebuild.sh ## Add the Servername to the apache2 conf file. -## RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf +## RUN echo "ServerName wcms-docker" >> /etc/apache2/apache2.conf # Copy our custom entrypoint and make it executable. COPY docker-entrypoint-d7.sh /usr/local/bin/ diff --git a/build-scripts/drupal7/docker-entrypoint-d7.sh b/build-scripts/drupal7/docker-entrypoint-d7.sh index 6222ee9..17766a0 100644 --- a/build-scripts/drupal7/docker-entrypoint-d7.sh +++ b/build-scripts/drupal7/docker-entrypoint-d7.sh @@ -24,14 +24,14 @@ if [ -n "$APACHE_SITE_NAME" ]; then fi # Allow for site aliases to be provided. -APACHE_SITE_ALIAS="${APACHE_SITE_ALIAS:-docker.localhost}" +APACHE_SITE_ALIAS="${APACHE_SITE_ALIAS:-wcms-docker}" if [ -n "$APACHE_SITE_ALIAS" ]; then sed -i 's@^\s*ServerAlias.*@'" ServerAlias ${APACHE_SITE_ALIAS}"'@' /etc/apache2/sites-available/000-default.conf fi ## Change default PHP to 5.6 (just to be sure). -a2dismod php7.2 && a2enmod php5.6 && update-alternatives --set php /usr/bin/php5.6 && service apache2 restart +#a2dismod php7.2 && a2enmod php5.6 && update-alternatives --set php /usr/bin/php5.6 && service apache2 restart ## Change permissions on /var/www/drupal7 chown -R vagrant:www-data /var/www/drupal7 diff --git a/build-scripts/drupal7/settings.conf b/build-scripts/drupal7/settings.conf index b536bf5..e397ea5 100644 --- a/build-scripts/drupal7/settings.conf +++ b/build-scripts/drupal7/settings.conf @@ -1,7 +1,7 @@ <?php // Server domain name. -$UWhost = 'localhost:4443'; +$UWhost = 'wcms-docker:4443'; // Path to site root. $UWpref = 'fdsu1'; // Name of site database. @@ -17,8 +17,8 @@ require_once(DRUPAL_ROOT . '/profiles/uw_base_profile/drupal-settings.php'); // File system. $conf['file_default_scheme'] = 'public'; -$conf['file_private_path'] = '/var/www/drupal7/sites/localhost.fdsu1/files/private/'; -$conf['file_public_path'] = '/var/www/drupal7/sites/localhost.fdsu1/files'; -$conf['file_temporary_path'] = '/var/www/drupal7/sites/localhost.fdsu1/files/temp/'; +$conf['file_private_path'] = '/var/www/drupal7/sites/wcms-docker.fdsu1/files/private/'; +$conf['file_public_path'] = '/var/www/drupal7/sites/wcms-docker.fdsu1/files'; +$conf['file_temporary_path'] = '/var/www/drupal7/sites/wcms-docker.fdsu1/files/temp/'; unset ($conf['file_chmod_directory']); unset ($conf['file_chmod_file']); \ No newline at end of file diff --git a/build-scripts/drupal8/000-default.conf b/build-scripts/drupal8/000-default.conf index 63af204..11cca22 100644 --- a/build-scripts/drupal8/000-default.conf +++ b/build-scripts/drupal8/000-default.conf @@ -1,8 +1,8 @@ <VirtualHost *:80> DocumentRoot /var/www/drupal8 ServerAdmin webmaster@localhost - ServerName localhost - Redirect permanent / https://localhost/ + ServerName wcms-docker + Redirect permanent / https://wcms-docker/ <Directory /> Options FollowSymLinks AllowOverride None @@ -17,7 +17,7 @@ <VirtualHost *:443> ServerAdmin webmaster@localhost DocumentRoot /var/www/drupal8 - ServerName localhost + ServerName wcms-docker <Directory /> Options FollowSymLinks AllowOverride None diff --git a/build-scripts/drupal8/docker-entrypoint.sh b/build-scripts/drupal8/docker-entrypoint.sh index 5ee7a61..bdca697 100644 --- a/build-scripts/drupal8/docker-entrypoint.sh +++ b/build-scripts/drupal8/docker-entrypoint.sh @@ -30,7 +30,7 @@ if [ -n "$APACHE_SITE_NAME" ]; then fi # Allow for site aliases to be provided. -APACHE_SITE_ALIAS="${APACHE_SITE_ALIAS:-docker.localhost}" +APACHE_SITE_ALIAS="${APACHE_SITE_ALIAS:-wcms-docker}" if [ -n "$APACHE_SITE_ALIAS" ]; then sed -i 's@^\s*ServerAlias.*@'" ServerAlias ${APACHE_SITE_ALIAS}"'@' /etc/apache2/sites-available/000-default.conf -- GitLab