Drupal Resources: OpenEuropa-European Commission

Written on May 21, 2019

Category: Drupal Resources

Author: David Rodríguez, @davidjguru

Picture from Unsplash, by @peterlaster
Picture from Unsplash, user Pedro Lastra @peterlaster

“European Commission DIGIT initiative fostering open source adoption in consolidating the European Institutions web presence”…ummm what is this? I want to share -briefly- the process of installing a platform based on Drupal 8.

Introduction

Did you know that there is an initiative to standardize projects based on Drupal in the context of the European Union? It’s called OpenEuropa and it’s a set of tools and documentation ready to be download, installed and shared…released as OpenSource and part of the OpenEuropa Iniciative https://github.com/openeuropa

This set of resources contains components such as a Task Runner based on Robo or a Visual Theme for Drupal and also a custom version of Drupal 8 called “Drupal Site Template” https://github.com/openeuropa/drupal-site-template I have done some initial tests with this project and I want to leave here the installation guidelines. I took instructions from here and there and mixing them, I have managed to boot Drupal Site Template in my environments. Now I have a centralized recipe. I put it here, in case someone needs it.

Composing the environment

Environment:

  • OS - Ubuntu 18.04
  • PHP - 7.3.5 (but the container will run with its own PHP 7.1).

Prerequisites:

  • Docker
  • Docker Compose

Installing Docker

sudo apt install -y build-essential apt-transport-https ca-certificates jq curl software-properties-common file
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install -y docker-ce
sudo chmod 666 /var/run/docker*
systemctl is-active docker

Installing Docker Compose

VERSION=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | jq .name -r)
DESTINATION=/usr/local/bin/docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m) -o $DESTINATION
sudo chmod 755 $DESTINATION
docker-compose --version

Installing OpenEuropa Drupal 8 Site

First: Stop your Apache webserver

sudo /etc/init.d/apache2 stop

Second: Clone the OpenEurope Drupal Project

git clone https://github.com/openeuropa/drupal-site-template.git

Third: Run the project

cd drupal-site-template
docker-compose up -d
docker-compose exec web composer install

Docker inspect container to get the IP

Fourth: Get the ID of the web container and inspect it

docker ps
docker container inspect IDCONTAINER

Tip: The ID of the container with /web inside (drupal_site_template_web_1) will have always the same ID. You only have to watch it once.

Fifth: Get the IP of the container and see it in browser

sensible-browser IPCONTAINER:8080

Open Drupal in Browser

Sixth: Connect to the container

docker exec -it IDCONTAINER /bin/bash 

Seventh: Run the installer / Task Runner

./vendor/bin/run toolkit:install-clean

Eighth: Export configuration files from database to config/sync

./vendor/bin/drush cex

Ninth: Visit your new project in

http://IPCONTAINER:8080/web 

Happy Hacking!

Login Drupal OpenEuropa


Written on May 21, 2019