Docker configuration - Henryisgreat/GROUP14Final GitHub Wiki

Abstract

Install Drupal with PostgreSQL using Docker compose.

  • Drupal is a free and open-source web content management framework written in PHP and distributed under the GNU General Public License.
  • PostgreSQL, also known as Postgres, is a free and open-source relational database management system emphasizing extensibility and SQL compliance.

Networking

  1. Set host-name to docker
  • sudo nano /etc/hostname
  1. Change network info using netplan
  • sudo nano /etc/netplan/50-cloud-init.yaml
  • Hostname: Docker
  • IP: [10.0.5.50/24]
  • DNS Servers: [10.0.5.10, 10.0.5.11]
  • Search Domain: [group14.local]
  • dhcp4: no
  • Gateway4: 10.0.5.2

Install Docker

  • Make sure you have the necessary packages to allow the use of Docker’s repository
  • sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg
  • Add Docker’s GPG key
  • curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  • Verify the fingerprint of the GPG key
  • sudo apt-key fingerprint 0EBFCD88
  • Add the stable Docker repository
  • sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  • Update your package index and install Docker CE
  • sudo apt update
  • sudo apt install docker-ce

Install Docker Compose

  • Download the latest version of Docker Compose
  • sudo curl -L https://github.com/docker/compose/releases/download/1.25.5/docker-compose-uname -s-uname -m -o /usr/local/bin/docker-compose
  • Set file permissions
  • sudo chmod +x /usr/local/bin/docker-compose

Set Up Drupal

  • Create a new directory drupal
  • mkdir ~/drupal/
  • cd ~/my_drupal/
  • sudo nano docker-compose.yml
  • docker-compose.yml
  • Run the docker container
  • docker-compose up -d
  • Go to ip in browser
  • On set up page
  • Database name: postgres
  • Database username: postgres
  • Database password: The password set in the docker-compose.yml file
  • Host (under Advanced Options): postgres