Skip to content

Instantly share code, notes, and snippets.

@nikathone
Last active April 16, 2020 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikathone/fbd68255969d584200f659abeeb55cd0 to your computer and use it in GitHub Desktop.
Save nikathone/fbd68255969d584200f659abeeb55cd0 to your computer and use it in GitHub Desktop.
Orlando Cambridge docker compose

Orlando Cambridge Docker compose

All the commands below assume you are on mac or linux distribution OS.

0. Prerequisites

1. First time user

1.2. Running the containers

  1. Open the terminal
  2. Run mkdir orlando_cambridge && cd $_ to create a folder where the docker compose file will be downloaded.
  3. Download the docker-compose.yml in this gist by using curl:
curl https://gist.githubusercontent.com/nikathone/fbd68255969d584200f659abeeb55cd0/raw/c8d9627b86a28ade68687cd1f1e7a8ae6485c7a4/docker-compose.yml --output docker-compose.yml

Just in case GitHub might be down, I have the same docker-compose.yml on GitLab and running the command below should give you the same result

curl https://gitlab.com/snippets/1960299/raw --output docker-compose.yml
  1. Run docker-compose up --detach
  2. Wait for about 8-10min after the command above has finished
  3. Navigate to http://localhost:8000
  4. Navigate at http://localhost:8000/user/login and use orlando for username and orlando for password

In case you didn't create a directory folder named orlando_cambridge, then make sure that you replace orlando_cambridge with the name of your directory for the rest of this documentation.

1.3. Bringing down the container

  1. Run docker-compose down --remove-orphans if you plan to re-test in a near future and don't want to wait for 8-10min for drupal to re-install everything
  2. Or run docker-compose down --remove-orphans --volume to delete the database and drupal files persistant volume storage

2. Regular usage

  1. Open the terminal
  2. Navigate to the orlando_cambrigde folder as created in the section 1.2 above
  3. Ensure that the current docker-compose.yml is exactly configured as the one in this gist
  4. Get the latest deployed image by running docker-compose pull. This image contains the latest deployed code found in the master branch at https://gitlab.com/calincs/access/orlando-cambridge
  5. Run docker-compose up --detach

For bringing down the containers follow the same steps as in section 1.3.

3. Troubleshooting

3.1. Docker

If you navigate at http://localhost:8000 and you don't see anything or there is a browser error:

  1. Open the terminal
  2. Navigate to the orlando_cambrigde folder as created in the section 1.2 above
  3. Run docker container logs orlando_cambridge_drupal_1 and send me the screenshot.

3.2. Useful commands

  • open .: Opens the current forder from terminal in Finder
  • pwd: Command which tells you where you are
  • cd ..: Move one directory up
  • cd -: Navigate back to the latest directory you were in
  • cd ~: Go back to your current home directory
version: "2.4"
## ISLE 8 Draft Prototype
## Feb, 2020
## MVP 1 - Traefik, Solr, MySQL & Drupal (using Woodby images for Apache, Drupal and Solr)
## MVP 2 - Microservices & Connectors (Houdini, Homarus, Hypercube, FITS, ActiveMQ and Cantaloupe)
services:
mariadb:
image: mariadb:10.3.22
environment:
MYSQL_DATABASE: ${DB_NAME:-drupal}
MYSQL_USER: ${DB_USER:-drupal}
MYSQL_PASSWORD: ${DB_PASSWORD:-dbpassword}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-dbpassword}
volumes:
- mariadb-data:/var/lib/mysql
healthcheck:
# https://dev.mysql.com/doc/refman/8.0/en/mysqladmin.html#command_mysqladmin_ping
test: ["CMD", "mysqladmin", "ping", "--silent"]
drupal:
image: registry.gitlab.com/calincs/access/orlando-cambridge/master:latest
depends_on:
mariadb:
condition: service_healthy
ports:
- 8000:8080
environment:
APP_NAME: ${APP_NAME:-orlando}
APP_ROOT: ${APP_ROOT:-/var/www/app}
APP_ACCOUNT_NAME: ${DRUPAL_USER_NAME:-orlando}
APP_ACCOUNT_MAIL: ${DRUPAL_USER_EMAIL:-orlando@example.com}
APP_ACCOUNT_PASS: ${APP_ACCOUNT_PASS:-orlando}
DB_NAME: ${DB_NAME:-drupal}
DB_USER: ${DB_USER:-drupal}
DB_PASSWORD: ${DB_PASSWORD:-dbpassword}
DB_HOST: "mariadb"
DB_PORT: ${DB_PORT:-3306}
DB_DRIVER: ${DB_DRIVER:-mysql}
DRUSH_OPTIONS_URI: "${DRUPAL_LOCAL_URL:-localhost:8000}"
DRUPAL_HASH_SALT: ${DRUPAL_HASH_SALT:-tfvQNpDFG2CjY9WHGNgFqC3eoMjyg5pZdGMQ74zjmnIoe0bi8F3hUvBWnGFIAM3nnj2iWA}
NGINX_LISTEN_PORT: "8080"
AUTO_INSTALL: "true"
volumes:
- drupal-files:${FILES_DIR:-/mnt/files}
volumes:
mariadb-data:
drupal-files:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment