Skip to content

Instantly share code, notes, and snippets.

@fjmk
Created August 23, 2017 10:58
Show Gist options
  • Save fjmk/a398772e29cc86981e18790ee476510a to your computer and use it in GitHub Desktop.
Save fjmk/a398772e29cc86981e18790ee476510a to your computer and use it in GitHub Desktop.
Added second DB named mvp in lines 51-63 of docksal.yml file
Changed database setting for mvp site in line 5 of settings.local.php
# Docker and Docker Compose based environment for Drupal.
# See https://github.com/docksal/docksal for more information and documentation.
# This is a shared configuration file that is intended to be stored in the project repo.
# For local overrides:
# - create .docksal/docksal-local.yml file and put local docker-compose configuration overrides there
# - add .docksal/docksal-local.yml to .gitignore
# Docksal stitches several docker-compose configuration files together.
# Run "fin config" to see which files are involved and the resulting configration.
version: "2.1"
services:
# Web
web:
hostname: web
image: docksal/web:2.0-apache2.4
volumes:
# Project root volume
- project_root:/var/www:ro,nocopy
labels:
- io.docksal.virtual-host=${VIRTUAL_HOST},*.${VIRTUAL_HOST}
- io.docksal.project-root=${PROJECT_ROOT}
environment:
- APACHE_DOCUMENTROOT=/var/www/${DOCROOT:-docroot}
- APACHE_BASIC_AUTH_USER
- APACHE_BASIC_AUTH_PASS
depends_on:
- cli
dns:
- ${DOCKSAL_DNS1}
- ${DOCKSAL_DNS2}
# DB
db:
hostname: db
image: docksal/db:1.1-mysql-5.6
ports:
- "${MYSQL_PORT_MAPPING:-3306}"
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
- MYSQL_USER=${MYSQL_USER:-user}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-user}
- MYSQL_DATABASE=${MYSQL_DATABASE:-default}
dns:
- ${DOCKSAL_DNS1}
- ${DOCKSAL_DNS2}
# MVP DB
mvp:
hostname: mvp
image: docksal/db:1.1-mysql-5.6
ports:
- "${MYSQL_PORT_MAPPING:-3306}"
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
- MYSQL_USER=${MYSQL_USER:-user}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-user}
- MYSQL_DATABASE=${MYSQL_DATABASE:-default}
dns:
- ${DOCKSAL_DNS1}
- ${DOCKSAL_DNS2}
# CLI
# Used for all console commands and tools.
cli:
hostname: cli
image: docksal/cli:1.3-php5
volumes:
# Project root volume
- project_root:/var/www:rw,nocopy
# Shared ssh-agent socket
- docksal_ssh_agent:/.ssh-agent:ro
environment:
- HOST_UID
- HOST_GID
- PROJECT_ROOT=/var/www
- DOCROOT
- XDEBUG_ENABLED=${XDEBUG_ENABLED:-0}
dns:
- ${DOCKSAL_DNS1}
- ${DOCKSAL_DNS2}
<?php
# Docker DB connection settings.
$databases['default']['default'] = array (
'database' => 'mvp',
'username' => 'user',
'password' => 'user',
'host' => 'db',
'driver' => 'mysql',
);
# File system settings.
$conf['file_temporary_path'] = '/tmp';
# Workaround for permission issues with NFS shares in Vagrant
$conf['file_chmod_directory'] = 0777;
$conf['file_chmod_file'] = 0666;
# Reverse proxy configuration (Docksal's vhost-proxy)
$conf['reverse_proxy'] = TRUE;
$conf['reverse_proxy_addresses'] = array($_SERVER['REMOTE_ADDR']);
// HTTPS behind reverse-proxy
if (
isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' &&
!empty($conf['reverse_proxy']) && in_array($_SERVER['REMOTE_ADDR'], $conf['reverse_proxy_addresses'])
) {
$_SERVER['HTTPS'] = 'on';
// This is hardcoded because there is no header specifying the original port.
$_SERVER['SERVER_PORT'] = 443;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment