ce-dev

Getting started

Note: this tutorial always refers to docker and docker compose, never to sudo docker and sudo docker compose, for readability. Adapt the commands accordingly for your setup. We also use indifferently “host”, “host machine”, “laptop” or “workstation” to refer to the machine you’re using ce-dev on; and “guest”, “container” or “service” to refer to running containers. It will still work the same whether you actually use a laptop or not 😉

Quickstart

Lets create a new Drupal 8 project. In a terminal cd to some convenient location, eg ~/Code or ~/Projects, and type:

ce-dev create

You’ll be prompted for a name for your project. We’ll use “hello” in this example. Keep it simple and short, and use only lowercase letters and numbers. This avoids issues when it’s later reused in various places (server name, database names, etc) that struggle with underscores or hyphens.

Pick “drupal8” as the project type.

This will generate a new “hello” directory, intialized as local git repo, with the following structure:

.
└── ce-dev
    ├── ansible
    │   ├── deploy.yml
    │   └── provision.yml
    ├── ce-dev.compose.prebuilt.yml
    └── ce-dev.compose.yml

We can now initialize the project:

cd hello
ce-dev init

What this has done is:

Next step is to start our containers.

ce-dev start

What happened is:

We now need to configure the containers.

ce-dev provision

We have used Ansible to provision the running containers:

So, we have running containers, with the needed software installed and configured, but we still need one last step:

ce-dev deploy

We have used Ansible (again) to setup the application . In short, we’ve basically done

We’re now ready to go and start using our newly spinned up instance:

ce-dev browse

That should open https://www.hello.local in a new browser’s tab, with a fresh Drupal instance.

ce-dev shell

Will open a shell in the ‘web’ container. You can then cd ~/deploy/live.local and run a vendor/drush/drush/drush uli to grab a login link.