Drupal

Framework
Drupal
Category
Full Stack
Publisher
Jetify
{
  "packages": {
    "git":                    "latest",
    "php":                    "8.1",
    "php81Packages.composer": "latest",
    "mariadb":                "latest",
    "nginx":                  "latest",
    "curl": {
      "version": "latest",
      "outputs": ["bin"]
    }
  },
  "env": {
    "MYSQL_UNIX_PORT": "/tmp/devbox/mariadb/run/mysql.sock"
  },
  "shell": {
    "init_hook": [],
    "scripts": {
      "run_test": [
        "mkdir -p -m 0755 \"$(dirname \"$MYSQL_UNIX_PORT\")\"",
        "ls -la .devbox .devbox/virtenv .devbox/virtenv/mariadb .devbox/virtenv/mariadb/data || true",
        "devbox services up -b",
        "echo 'Waiting for services to start' && sleep 5",
        "./install-drupal.sh",
        "curl localhost:8081",
        "devbox services stop"
      ]
    }
  }
}

Drupal Stack

This example shows how to run a Drupal application in Devbox. It makes use of the PHP and Apache Plugins, while demonstrating how to configure a MariaDB instance to work with Devbox Cloud.

Open In Devbox.sh

How to Run the example

In this directory, run:

devbox shell

To start all your services (PHP, MySQL, and NGINX), run devbox services up. To stop the services, run devbox services stop

To create the devbox_drupal database and example table, you should run:

mysql -u root < setup_db.sql

To install Drupal and your dependencies, run composer install. The Drupal app will be installed in the /web directory, and you can configure your site by visiting localhost:8000/autoload in your browser and following the interactive instructions

To exit the shell, use exit

Configuration

Because the Nix Store is immutable, we need to store our configuration, data, and logs in a local project directory. This is stored in the devbox.d directory, in a subfolder for each of the packages that we will be installing.

README.md

Level up your dev environment

Checkout the Devbox and Launchpad open-source codebases on Github. Feature requests are always welcome.
Try Devbox Cloud
YOUR INPUT COUNTS

Join the community

Discuss ideas, uses and builds with the Jetpack team and others.