Giter Site home page Giter Site logo

boilerplate-drupal8's Introduction

Docksal powered Drupal 8 Installation

This is a sample vanilla Drupal 8 installation pre-configured for use with Docksal.

Features:

Setup instructions

Step #1: Docksal environment setup

This is a one time setup - skip this if you already have a working Docksal environment.

Follow Docksal environment setup instructions

Step #2: Project setup

  1. Clone this repo into your Projects directory

    git clone https://github.com/docksal/boilerplate-drupal8.git drupal8
    cd drupal8
    
  2. Initialize the site

    This will initialize local settings and install the site via drush

    fin init
    
  3. Point your browser to

    http://drupal8.docksal
    

When the automated install is complete the command line output will display the admin username and password.

More automation with 'fin init'

Site provisioning can be automated using fin init, which calls the shell script in .docksal/commands/init.
This script is meant to be modified per project. The one in this repo will give you a good starting example.

Some common tasks that can be handled by the init script (an other custom commands):

  • initialize local settings files for Docker Compose, Drupal, Behat, etc.
  • import DB or perform a site install
  • compile Sass
  • run DB updates, revert features, clear caches, etc.
  • enable/disable modules, update variables values

Security notice

This repo is intended for quick start demos and includes a hardcoded value for hash_salt in settings.php.
If you are basing your project code base on this repo, make sure you regenerate and update the hash_salt value.
A new value can be generated with drush ev '$hash = Drupal\Component\Utility\Crypt::randomBytesBase64(55); print $hash . "\n";'

boilerplate-drupal8's People

Contributors

david-hernandez avatar lmakarov avatar milka-petkova-ffw avatar ownsourcing avatar sergey-zabolotny avatar shelane avatar

Stargazers

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

Watchers

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

boilerplate-drupal8's Issues

Init Documentation

Hi! Thanks for developing this useful implementation of Docker. I've gotten one of our most complex Drupal 8 sites up and running on my Mac using this methodology. It works great. The only thing that I'm not sure about is how I should set up my init script. The Drupal 7 one seems to imply everything goes into the one init script. The Drupal 8 one splits the script into two files: "init" and "init-site". Adding my commands to init-site doesn't seem to work for whatever reason - I'm guessing because Docksal isn't declared there. What I did was create a new script called "init-local" and called it with fin init-local from the main init script. Calling it from the init-site script didn't work because it didn't understand what the "fin" command was.

Is this correct? I'm concerned a future fin update will overwrite the line I added to the init file. I guess if it's working, then that's great, but I want to make sure it's the correct way to go about doing it so we're compliant with standards going forward.

Here's the code I'm executing in init-local:

SITE_DIRECTORY="default"
DOCROOT_PATH="${PROJECT_ROOT}/${DOCROOT}"
SITEDIR_PATH="${DOCROOT_PATH}/sites/${SITE_DIRECTORY}"
fin stop
fin start
cd ${DOCROOT_PATH}
echo "Dropping database..."
fin drush sql-drop -y
echo "Importing database from /docroot/db/db.sql";
fin sqli ./db/db.sql --db=default
fin drush en stage_file_proxy -y
fin drush cr

And here's the line I added to init:

# run the local settings script
fin init-local

Thanks, in advance, for your help.
=Adam=

DOCROOT variable not available in custom command

If exec_target is set to cli, the $DOCROOT variable is not available.

I've tested it with a super simple command:

#!/usr/bin/env bash

#: exec_target = cli

echo $DOCROOT

This results in no output.

However, just this does:

#!/usr/bin/env bash

echo $DOCROOT

DOCROOT is defined in my .docksal/docksal.env file. Other variables such as $PROJECT_ROOT are fine.

Link to Docksal setup is incorrect

Goes to a dead page - https://docs.docksal.io/en/master/getting-started/env-setup

Correct link is: https://docs.docksal.io/getting-started/setup/

Use xip.io service for IP addresses

There is xip.io service to map domains to ip addresses automatically (when service is accessible).

So instead of using a host like drupal8.docksal you can have drupal8.192.168.10.10.xip.io and if users have access to service it will map automatically.

Drush is failing

Hi

Followed below steps

  1. Clone this repo into your Projects directory
    git clone https://github.com/docksal/boilerplate-drupal8.git drupal8
    cd drupal8

2.initialize the site
fin init
local website http://drupal8.docksal is loading perfectly but drush is not working

When i run "drush st"
i get only few details, find below.

docker@cli:/var/www$ drush st
PHP configuration :
PHP OS : Linux
Drush script : /usr/local/bin/drush8
Drush version : 8.4.5
Drush temp directory : /tmp
Drush configuration :
Drush alias files :

Add a default --root for fin drupal

It's not an issue, I have more of a question. I want to customize the DOCROOT to be build/html, but weirdly if it's two levels deep then it won't auto find drupal console in build/html/vendors.

I actually don't even want the drupal console and vendors directory in the drupal root anyway because in particular config it's in the project root. What I'd like to do is instead just tell fin that every time you call fin drupal, give it the parameter of fin drupal --root=/var/www/build/html, that seems to work just fine.

Is this possible?

@docksal drush alias not available after clean install

I am new to Docksal and am testing out the drupal8 sample project to get acquainted. After getting it going, I am finding the default drush alias does not seem to be available for me. Thank you.

Expected result
@docksal drush alias would be available when typing fin drush sa.

Actual result
@none is the only alias available.

Steps to reproduce

$ git clone [email protected]:docksal/drupal8.git && cd drupal8
Cloning into 'drupal8'...
remote: Counting objects: 42945, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 42945 (delta 6), reused 0 (delta 0), pack-reused 42929
Receiving objects: 100% (42945/42945), 26.18 MiB | 12.64 MiB/s, done.
Resolving deltas: 100% (18003/18003), done.
Checking out files: 100% (13604/13604), done.

$ fin init
Step 1  Initializing stack...
Removing containers...
Removing drupal8_web_1 ... done
Removing drupal8_cli_1 ... done
Removing drupal8_db_1  ... done
Removing network drupal8_default
Removing volume drupal8_project_root
Volume docksal_ssh_agent is external, skipping
Starting services...
Creating network "drupal8_default" with the default driver
Creating volume "drupal8_project_root" with local driver
Creating drupal8_cli_1 ...
Creating drupal8_db_1 ...
Creating drupal8_cli_1
Creating drupal8_cli_1 ... done
Creating drupal8_web_1 ...
Creating drupal8_web_1 ... done
Waiting for drupal8_cli_1 to become ready...
Connected vhost-proxy to "drupal8_default" network.
Waiting 10s for MySQL to initialize...
 Step 2  Initializing site...
Making site directory writable...
Copying /var/www/docroot/sites/default/settings.local.php...
You are about to DROP all tables in your 'default' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the --notify global option.
Installation complete.  User name: admin  User password: Wf2mVRg4wq
Congratulations, you installed Drupal!

real	0m32.203s
user	0m10.450s
sys	0m6.480s
DONE!  Open http://drupal8.docksal in your browser to verify the setup.

$ fin drush cc drush
'drush' cache was cleared.

$ fin drush sa
@none

$ fin drush @docksal status
Could not find the alias @docksal

One time "Minimal fin version required is: 1.22.0"

Using fin project create with drupal8 results in the error:

Minimal fin version required is: 1.22.0

Then running fin init manually - everything works as expected.

leonid@ubuntu:~/projects$ fin project create
WARNING: No swap limit support
             -= Docksal project wizard =-

1. Enter the name of your project (no spaces or slashes): drupal8

2. What would you like to install?
   [1] Drupal 7
   [2] Drupal 8
   [3] Wordpress
   [4] Magento
   [5] Static HTML site
   [6] Grav CMS
   [7] Gatsby JS
   [8] Laravel

Enter your choice (1-8): 2

Your site will be created at /home/leonid/projects/drupal8
Your site will run Drupal 8
The URL of your site will be http://drupal8.docksal

Do you wish to proceed? [y/n]: 
Please answer yes or no.
Do you wish to proceed? [y/n]: y
Cloning repository...
Cloning into 'drupal8'...
remote: Counting objects: 42945, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 42945 (delta 6), reused 0 (delta 0), pack-reused 42929
Receiving objects: 100% (42945/42945), 26.18 MiB | 4.79 MiB/s, done.
Resolving deltas: 100% (18002/18002), done.
Checking connectivity... done.
3. Installing site
WARNING: No swap limit support
WARNING: No swap limit support
Minimal fin version required is: 1.22.0
leonid@ubuntu:~/projects$ fin -v
WARNING: No swap limit support
1.43.2
leonid@ubuntu:~/projects$ cd drupal8/
leonid@ubuntu:~/projects/drupal8$ fin init
WARNING: No swap limit support
WARNING: No swap limit support
 Step 1  Initializing stack...
WARNING: No swap limit support
Removing containers...
Removing network drupal8_default
WARNING: Network drupal8_default not found.
Removing volume drupal8_project_root
WARNING: Volume drupal8_project_root not found.
Volume docksal_ssh_agent is external, skipping
Starting services...
...

Using fin project create second time - no issues. Weird.

Admin username and password

Please pardon my ignorance...
I've successfully installed the Docksal Drupal 8 boilerplate on my Mac and things went smoothly. I'm now stuck on the Login page: could you please help me find the default admin username and password?
Thanks : )

fin init with no errors but "This site can’t be reached"

how can I debug this ?
here is the output of the fin init

WARNING: Usage of loopback devices is strongly discouraged for production use. Use--storage-opt dm.thinpooldevto specify a custom block storage device. WARNING: No swap limit support Step 1 Initializing local project configuration... /home/giorgos/websites/drupal8/docroot/sites/default/settings.local.php already in place. Step 2 Recreating services... WARNING: Usage of loopback devices is strongly discouraged for production use. Use--storage-opt dm.thinpooldevto specify a custom block storage device. WARNING: No swap limit support Removing containers... Removing drupal8_web_1 ... done Removing drupal8_cli_1 ... done Removing drupal8_db_1 ... done Removing network drupal8_default Removing volume drupal8_project_root Volume docksal_ssh_agent is external, skipping Removing volume drupal8_host_home Starting services... Creating network "drupal8_default" with the default driver Creating volume "drupal8_project_root" with local driver Creating volume "drupal8_host_home" with local driver Creating drupal8_cli_1 Creating drupal8_db_1 Creating drupal8_web_1 Waiting 10s for MySQL to initialize... Step 3 Installing site... WARNING: Usage of loopback devices is strongly discouraged for production use. Use--storage-opt dm.thinpooldev` to specify a custom block storage device.
WARNING: No swap limit support
You are about to DROP all tables in your 'default' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the --notify global option. [ok]
Installation complete. User name: admin User password: JxX6zNJKzJ [ok]
Congratulations, you installed Drupal! [status]

real 0m48.688s
user 0m0.412s
sys 0m0.064s
DONE! Open http://drupal8.docksal in your browser to verify the setup.
`

Create a port for D9

Looks like this is not able to be used in D9 now. The mysql version is not compatible. A new D9 boilerplate is needed. Thanks for your hard work on this!

[error] - fin init (drupal8)

Trying to install drupal8 on mac.

$ fin init

 Step 1  Initializing stack...
Removing containers...
Removing drupal8_web_1 ... done
Removing drupal8_cli_1 ... done
Removing drupal8_db_1  ... done
Removing network drupal8_default
Removing volume drupal8_project_root
Volume docksal_ssh_agent is external, skipping
Starting services...
Creating network "drupal8_default" with the default driver
Creating volume "drupal8_project_root" with local driver
Creating drupal8_db_1 ...
Creating drupal8_db_1
Creating drupal8_cli_1 ...
Creating drupal8_cli_1 ... done
Creating drupal8_web_1 ...
Creating drupal8_web_1 ... done
Waiting for drupal8_cli_1 to become ready...
Connected vhost-proxy to "drupal8_default" network.
Waiting 10s for MySQL to initialize...
 Step 2  Initializing site...
Making site directory writable...
/var/www/docroot/sites/default/settings.local.php already in place.
You are about to DROP all tables in your 'default' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the --notify global option.                                                                                                   [ok]
Drupal\Core\Config\UnmetDependenciesException: Configuration objects provided by <em class="placeholder">standard</em> have unmet dependencies: <em                                            [error]
class="placeholder">core.entity_form_display.user.user.default (field.field.user.user.user_picture)</em> in /var/www/docroot/core/lib/Drupal/Core/Config/UnmetDependenciesException.php:98
Stack trace:
#0 /var/www/docroot/core/lib/Drupal/Core/Config/ConfigInstaller.php(469): Drupal\Core\Config\UnmetDependenciesException::create('standard', Array)
#1 /var/www/docroot/core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php(132): Drupal\Core\Config\ConfigInstaller->checkConfigurationToInstall('module', 'standard')
#2 /var/www/docroot/core/lib/Drupal/Core/Extension/ModuleInstaller.php(141): Drupal\Core\ProxyClass\Config\ConfigInstaller->checkConfigurationToInstall('module', 'standard')
#3 /var/www/docroot/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Array, false)
#4 /var/www/docroot/core/includes/install.core.inc(1572): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, false)
#5 /var/www/docroot/core/includes/install.core.inc(662): install_install_profile(Array)
#6 /var/www/docroot/core/includes/install.core.inc(540): install_run_task(Array, Array)
#7 /var/www/docroot/core/includes/install.core.inc(117): install_run_tasks(Array)
#8 phar:///usr/local/bin/drush/includes/drush.inc(726): install_drupal(Object(Composer\Autoload\ClassLoader), Array)
#9 phar:///usr/local/bin/drush/includes/drush.inc(711): drush_call_user_func_array('install_drupal', Array)
#10 phar:///usr/local/bin/drush/commands/core/drupal/site_install.inc(82): drush_op('install_drupal', Object(Composer\Autoload\ClassLoader), Array)
#11 phar:///usr/local/bin/drush/commands/core/site_install.drush.inc(255): drush_core_site_install_version('standard', Array)
#12 phar:///usr/local/bin/drush/includes/command.inc(422): drush_core_site_install()
#13 phar:///usr/local/bin/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#14 phar:///usr/local/bin/drush/includes/command.inc(199): drush_command()
#15 phar:///usr/local/bin/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#16 phar:///usr/local/bin/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#17 phar:///usr/local/bin/drush/includes/startup.inc(458): drush_main()
#18 phar:///usr/local/bin/drush/includes/startup.inc(365): drush_run_main(false, '/', 'Phar detected. ...')
#19 phar:///usr/local/bin/drush/drush(114): drush_startup(Array)
#20 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#21 {main}

Slow log path not working

I'm getting this error with the mysql slow log configuration
db_1 | 2018-02-14T21:34:08.285416Z 0 [ERROR] Could not use /dev/stdout for logging (error 2 - No such file or directory). Turning logging off for the server process. To turn it on again: fix the cause, then either restart the query logging by using "SET GLOBAL SLOW_QUERY_LOG=ON" or restart the MySQL server.

any ideas what the fix is?

ERROR Cannot start service db: no such file or directory

I followed the following instructions to run the sample Drupal8 setup for Docksal:

https://github.com/docksal/drupal8

But when I ran fin init, the following errors were displayed:

ERROR: for db Cannot start service db: no such file or directory

ERROR: for cli Cannot create container for service cli: no such file or directory
ERROR: Encountered errors while bringing up the project.

I am using Docker for Mac and I have some custom mapping in my /etc/hosts. I read a similar post where there were problems with this situation but it did not elaborate on how it could be resolved.

Should be using some other type of Docker installation and can I not use custom /etc/hosts entries?

I ran fin init a second time and received the same errors.

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.