Giter VIP home page Giter VIP logo

dropfabrik's Introduction

Drop Fabrik

"Drop Fabrik" is configuration of Docker to help development more speedy for Drupal. You will be able to build a Drupal environment on Docker in 5 to 10 minutes with the following steps.

日本語のREADMEはこちら

Overview

Example configuration includes the following containers:

Container Service name Image Exposed port
Nginx Proxy nginx-proxy jwilder/nginx-proxy 80
Nginx web nginx
MariaDB db mariadb 3306
PHP-FPM 5.6 / 7.0 / 7.1 php blauerberg/drupal-php
mailhog mailhog mailhog/mailhog 8025 (HTTP server)
phpmyadmin phpmyadmin phpmyadmin/phpmyadmin 8080 (HTTP server)
dozzle dozzle amir20/dozzle 8081 (HTTP server)

Prerequisites

Getting started

Start containers

First, get a configurations.

$ git clone https://github.com/blauerberg/dropfabrik.git
$ cd dropfabrik

Next, create a directory to mount source code of Drupal.

$ mkdir -p volumes/drupal

download & extract Drupal source code.

# Note: replace "X.Y.Z" in below to  Drupal's version you'd like to use.
$ curl https://ftp.drupal.org/files/projects/drupal-X.Y.Z.tar.gz | tar zx --strip=1 -C volumes/drupal

If you use macOS, highly recommend using docker-sync to avoid performance problems. please see Use docker-sync.

create & start containers.

$ docker-compose up -d

if you use Linux host, you have to fix permissions for your Drupal directory with:

$ docker-compose exec php chown -R www-data:www-data /var/www/html/sites/default

Access your Drupal site.

$ open http://localhost # or open http://localhost on your browser.

Install Drupal

Credentials of database is configured in docker-compose.override.yml. Default value is below:

  • Database Name: drupal
  • Username: drupal
  • Password: drupal

Please see also "Environment Variables" section in https://hub.docker.com/_/mariadb/

In Dropfabrik, nginx, mariadb and php-fpm run on the separate containers. Therefore, please note that hostname of database server when installing Drupal is db, not localhost.

Instead of the installation wizard, you can install Drupal using Drush as follows:

$ docker-compose exec php drush -y --root="/var/www/html" site-install standard --site-name="Drupal on Docker" --account-name="drupal" --account-pass="drupal" --db-url="mysql://drupal:drupal@db/drupal"
$ docker-compose exec php drush -y config-set system.theme admin bartik

Stop containers

$ docker-compose stop

Other tips

It's not work for me!

Dropfabrik includes Dozzle to display logs inside the container on a browser. Let's go to http://localhost:8081 to see what's happening inside the container. If you can get some help from someone, it's a good idea to show the Dozzle log as it is.

Access inside the containers

You should use docker-compose exec instead of ssh.

$ docker-compose exec {Service name} /bin/bash
# ex. docker-compose exec php /bin/bash

Use Drush

Drush is installed in php container.

$ docker-compose exec php drush st

Restore database from existing site

Put gzipped sql dump as initdb.sql.gz and uncomment below line at docker-compose.override.yml. It will be loaded by mariadb and will restore once only at generating the container.

- ./initdb.sql.gz:/docker-entrypoint-initdb.d/initdb.sql.gz

Connect database

Via Drush:

$ docker-compose exec php drush sqlc

Database container is exposing port 3306 on 127.0.0.1. So you can access database in the container from GUI application on Host OS such as MysqlWorkbench, Sequel Pro.

Use docker-sync

If you use macOS, highly recommend installing docker-sync as follows to avoid performance problems.

If you use docker-sync please copy docker-compose.override-for-docker-sync.yml as docker-compose.override.yml. Also, you need to run the image with docker-sync-stack instead of docker-compose.

$ docker-sync-stack start

Please see also: https://github.com/EugenMayer/docker-sync/wiki

Supporting Organizations

dropfabrik's People

Contributors

blauerberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

yuukitoriyama

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.