Skip to content

Single-site Docker environment for Drupal local site development and migrations, for sites which feature a docroot.

License

Notifications You must be signed in to change notification settings

kafeiinteractif/stasis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stasis

Single-site Docker environment for Drupal local site development and migrations, for sites which feature a docroot.

Before you begin

  1. Inside the stasis folder, copy or link your Drupal folder. Rename the folder to be repo.

  2. After doing this, run ./deploy init d8 from the stasis folder to create your settings.php and services.yml files.

  3. Open a terminal window and run the following:

    docker-compose up

You can control-C to close this window when you are done using the servers. Meanwhile, you can watch these logs to see if anything weird is happening in your site.

  1. Run ./deploy to get access to the terminal and see the serer's IP address.

  2. When you are finished, run docker-compose down to power down the servers (or press ctrl-C in the terminal where the logs appear.

In some environments you may not be able to have repo as a simlink if the folder permissions are not appropriate. Consider testing repo as a folder if you are getting permission errors involving the current working directory on your local machine.

Command Overview:

Make sure that repo/docroot exists in this folder, containing your site's code first!

./deploy init        # copies the site's default.settings.php and default.services.yml
		 # to settings/settings.php and settings/services.yml
		 # so you can edit these if you need. The DB is set at
		 # the bottom if you add d7 or d8 as parameters (see
		 # below).  Docker will mount settings as
		 # docroot/sites/default.

./deploy init d7     # Will inject the DB values as well
./deploy init d8     # Will inject the DB values as well

./deploy si          # run the site installer
./deploy db          # import the sql/drupal.sql.gz

Start it, get a terminal and find public IP

Create a custom settings.php first if you have not already (see above).

./deploy init d8

Start up a console that will start the process and show the logs.

docker-compose up

Now, in another terminal window, run the following command in this folder.

./deploy

There you go! You should be able to use drush, drupal console, and composer.

When you are finished you can "exit" the deploy window if you wish. You can run the shutdown command from any terminal window:

docker-compose down

Migrations.

A secondary database called drupal_legacy is already configured and works the same as the regular db import command:

./deploy db_legacy   # import the sql/drupal_legacy.sql.gz DB

Delete DB

It will destroy the database container, so all DBs will be removed in one go. Server will restart when it is killed, so reloading will cause site installer to begin.

./deploy xx       # delete the DB so you can run a fresh db import later

About

Single-site Docker environment for Drupal local site development and migrations, for sites which feature a docroot.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published