{"id":15173069,"url":"https://github.com/mogtofu33/docker-compose-drupal","last_synced_at":"2025-10-01T10:31:15.680Z","repository":{"id":128488735,"uuid":"58024357","full_name":"mogtofu33/docker-compose-drupal","owner":"mogtofu33","description":"Drupal 8 Docker Compose dev stack.","archived":true,"fork":false,"pushed_at":"2020-12-29T13:07:42.000Z","size":6606,"stargazers_count":30,"open_issues_count":2,"forks_count":29,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-27T10:41:10.282Z","etag":null,"topics":["composer","docker","drupal","drupal-8","drupal-project","drupal8"],"latest_commit_sha":null,"homepage":"https://gitlab.com/mog33/docker-compose-drupal","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mogtofu33.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-04T05:08:13.000Z","updated_at":"2024-06-22T19:58:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"0ef20674-11ae-4af6-96f9-688a224ec8a8","html_url":"https://github.com/mogtofu33/docker-compose-drupal","commit_stats":{"total_commits":494,"total_committers":5,"mean_commits":98.8,"dds":0.6538461538461539,"last_synced_commit":"b924451e26a4cdb4afbc6cd7a7469a0fd2074c48"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mogtofu33%2Fdocker-compose-drupal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mogtofu33%2Fdocker-compose-drupal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mogtofu33%2Fdocker-compose-drupal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mogtofu33%2Fdocker-compose-drupal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mogtofu33","download_url":"https://codeload.github.com/mogtofu33/docker-compose-drupal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234858829,"owners_count":18897817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","docker","drupal","drupal-8","drupal-project","drupal8"],"created_at":"2024-09-27T10:40:33.120Z","updated_at":"2025-10-01T10:31:15.082Z","avatar_url":"https://github.com/mogtofu33.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Drupal 8 Docker Compose Development\n\n[![pipeline status](https://gitlab.com/mog33/docker-compose-drupal/badges/master/pipeline.svg)](https://gitlab.com/mog33/docker-compose-drupal/commits/master)\n\n- [Requirements](#requirements)\n- [Description](#description)\n  - [What's this?](#whats-this)\n  - [Services included](#services-included)\n    - [Database management](#database-management)\n- [Quick demo (Ubuntu)](#quick-demo-ubuntu)\n- [Installation and configuration](#installation-and-configuration)\n  - [Project installation](#project-installation)\n  - [Option 1: existing Drupal 8 project](#option-1-existing-drupal-8-project)\n    - [Copy codebase](#copy-codebase)\n    - [Import database](#import-database)\n    - [Launch the stack](#launch-the-stack)\n    - [Access the minimal dashboard](#access-the-minimal-dashboard)\n  - [Option 2: setup Vanilla Drupal 8 with Composer](#option-2-setup-vanilla-drupal-8-with-composer)\n    - [Code download](#code-download)\n    - [Launch the stack](#launch-the-stack-1)\n    - [Install Drupal 8](#install-drupal-8)\n    - [Access your Drupal 8](#access-your-drupal-8)\n- [Daily usage](#daily-usage)\n  - [Add some modules](#add-some-modules)\n  - [Enable some modules](#enable-some-modules)\n  - [Run a command on the server](#run-a-command-on-the-server)\n  - [Access the server with bash](#access-the-server-with-bash)\n- [Reset the stack](#reset-the-stack)\n  - [Destroy containers](#destroy-containers)\n  - [Remove your persistent data (and lost everything!)](#remove-your-persistent-data-and-lost-everything)\n- [Linux helpers](#linux-helpers)\n- [Upgrade](#upgrade)\n- [Suggested tools](#suggested-tools)\n- [Troubleshooting](#troubleshooting)\n  - [General problem](#general-problem)\n  - [Port 80](#port-80)\n  - [Windows](#windows)\n\n**Full** Linux support. Tested daily on Ubuntu 16+.\n\n**Windows** support is **very, very limited** due to Docker for [Windows permissions problems](https://github.com/docker/for-win/issues/1829) and no privileged support :(\n\n**Mac** support is **very limited** due to the fact that I don't have a Mac!\n\n## Requirements\n\n- [Docker engine 19+](https://docs.docker.com/install)\n- [Docker compose 1.26+](https://docs.docker.com/compose/install)\n\n**Recommended**\n\n- [Composer](https://getcomposer.org)\n\n## Description\n\n### What's this?\n\nBased mostly on [Docker official images](https://hub.docker.com/search/?type=image\u0026image_filter=official) and lightweight [Alpine Linux](https://alpinelinux.org/) to ease maintenance and size.\n\nThis stack is meant to be used as a single [Drupal 8](https://www.drupal.org/8) project only with quick setup, run and destroy workflow.\n\nThe purpose is to give flexibility in management, try to rely as much as possible on official tools to avoid any new custom patterns.\n\nThis stack is not a one line command but more for users with a good dev-op level and knowledge on each technology used.\n\nSee other great project for a Docker based development\n\n- [Lando](https://docs.devwithlando.io/tutorials/drupal8.html)\n- [Docksal](https://docksal.io/)\n- [ddev](https://github.com/drud/ddev)\n- [docker4drupal](https://github.com/wodby/docker4drupal)\n\n### Services included\n\n_Every service is optional as declared in the yml file._\n\n- Apache\n- Nginx\n- Php 7.3 / 7.4 fpm with Xdebug\n- MariaDB\n- PostgreSQL\n- [Memcache](https://hub.docker.com/_/memcached)\n- [Redis](https://redis.io/)\n- [Mailhog](https://github.com/mailhog/MailHog)\n- [Solr](http://lucene.apache.org/solr)\n- [Dashboard](https://cloud.docker.com/u/mogtofu33/repository/docker/mogtofu33/dashboard): a very minimal docker dashboard for this stack\n- [Portainer](https://github.com/portainer/portainer): (Optional) a full Docker dashboard / manager\n\n#### Database management\n\n- [Adminer](https://www.adminer.org)\n\n## Quick demo (Ubuntu)\n\nGet this project\n\n```bash\nwget https://gitlab.com/mog33/docker-compose-drupal/-/archive/master/docker-compose-drupal-master.tar.gz\ntar -xzf docker-compose-drupal-master.tar.gz\ncd docker-compose-drupal-master\n```\n\nInstall this stack with minimal services, download and install Drupal 8 with\nprofile [Demo Umami](https://www.drupal.org/project/demo_umami)\n\n```bash\nmake demo\n```\n\n## Installation and configuration\n\n### Project installation\n\nGrab this project\n\n```bash\nwget https://gitlab.com/mog33/docker-compose-drupal/-/archive/master/docker-compose-drupal-master.tar.gz\ntar -xzf docker-compose-drupal-master.tar.gz\ncd docker-compose-drupal-master\n```\n\nCreate your docker compose file from template\n\n```bash\ncp docker-compose.tpl.yml docker-compose.yml\ncp default.env .env\n```\n\n_Optional:_ Edit configuration\n\nRecommended on Unix add your local uid/gid.\n\n```bash\nvi .env\n```\n\n_Optional:_ Customize the stack\n\nChoose a database, remove or add services, add your composer cache folder if needed on service `php`.\nDo not touch for a default quick stack.\n\n```bash\nvi docker-compose.yml\n```\n\nCheck the yml file and fix if there is an error message\n\n```bash\ndocker-compose config\n```\n\n### Option 1: existing Drupal 8 project\n\n#### Copy codebase\n\nFor an existing Drupal 8 project, copy it here in a folder named `drupal`.\n\nSo you have your composer.json file in `drupal\\composer.json`\n\nNote that based on Composer template web root must be under `drupal/web`\nfolder. If not you need to adapt Apache vhost config from\n`config/apache/vhost.conf`\n\n```bash\ncp -r _YOUR_DRUPAL_ drupal\n```\n\n#### Import database\n\nFor **MySQL**, copy your database dump **uncompressed** in `./database/mysql-init/*.sql`, it\nwill be automatically imported on the first launch of the stack.\n\nFor **PostgresSQL**, copy your database dump **uncompressed** in `./database/pgsql-init/*.pg_dump`, it\nwill be automatically imported on the first launch of the stack.\n\nIf you want to manually import your database with adminer or included helper scripts\nwith _Linux_you can skip this step.\n\n#### Launch the stack\n\n```bash\ndocker-compose up --build -d\n```\n\nWait and check the import of your database dump with (change mysql to pgsql if needed)\n\n```bash\ndocker-compose logs mysql\n```\n\n#### Access the minimal dashboard\n\n- [http://localhost:8181](http://localhost:8181)\n\n### Option 2: setup Vanilla Drupal 8 with Composer\n\n#### Code download\n\nSetup a new Drupal 8 based on a Composer project.\n\nBased on [Drupal 8 template](https://github.com/drupal-composer/drupal-project), include [Drush](http://www.drush.org) and [Drupal console](https://drupalconsole.com/), using [Composer](https://getcomposer.org) locally:\n\n```bash\ncomposer create-project drupal-composer/drupal-project:8.x-dev drupal --stability dev --no-interaction\n```\n\n#### Launch the stack\n\n```bash\ndocker-compose up --build -d\n```\n\n#### Install Drupal 8\n\nTo use **PostGreSQL** change **mysql** to **pgsql**\n\nYou can replace **standard** by an other profile as **minimal** or **demo_umami** for [Drupal 8.6+](https://www.drupal.org/project/demo_umami).\n\n```bash\ndocker exec -it -u apache dcd-php /var/www/localhost/vendor/bin/drush -y site:install standard \\\n    --root=/var/www/localhost/web \\\n    --account-name=admin \\\n    --account-pass=password \\\n    --db-url=mysql://drupal:drupal@mysql/drupal\n    #--db-url=pgsql://drupal:drupal@pgsql/drupal\n```\n\n#### Access your Drupal 8\n\n- [http://localhost](http://localhost)\n\nLogin with _admin_ / _password_:\n\n- [http://localhost/user/login](http://localhost/user/login)\n\n## Daily usage\n\n### Add some modules\n\n```bash\ndocker exec -it -u apache dcd-php \\\n    composer --working-dir=/var/www/localhost require \\\n    drupal/admin_toolbar drupal/ctools drupal/pathauto drupal/token drupal/panels\n```\n\nWith _Linux_, you can use included helper script\n\n```bash\nscripts/composer require drupal/admin_toolbar drupal/ctools drupal/pathauto drupal/token drupal/panels\n```\n\n### Enable some modules\n\n```bash\ndocker exec -it -u apache dcd-php \\\n    /var/www/localhost/vendor/bin/drush -y en \\\n    --root=/var/www/localhost/web \\\n    admin_toolbar ctools ctools_block ctools_views panels token pathauto\n```\n\nWith _Linux_, you can use included helper script\n\n```bash\nscripts/drush -y en admin_toolbar ctools ctools_block ctools_views panels token pathauto\n```\n\n### Run a command on the server\n\n```bash\ndocker exec -it -u apache dcd-php \\\n    ls -lah /var/www/localhost/web\n```\n\n### Access the server with bash\n\n```bash\ndocker exec -it -w /var/www/localhost -u apache dcd-php bash\n```\n\n## Reset the stack\n\n### Destroy containers \n\n_Note:_ `./drupal/` is persistent but NOT the database files!\n\nSave your database under _Linux_\n\n```bash\nscripts/mysql dump\nscripts/pgsql dump\n```\n\nStop and remove containers\n\n```bash\ndocker-compose down\n```\n\n### Remove your persistent data (and lost everything!)\n\n```bash\nrm -rf data\n```\n\n## Linux helpers\n\nFor Ubuntu (16+) or Linux you can find in `./scripts/` multiple helpers to quickly\nrun some daily commands from root folder, and drush/drupal links at the root.\n\n```bash\n# Run drush or drupal within the container\nscripts/drush status\nscripts/drupal site:status\n# Quickly dump/restore/drop your DB\nscripts/mysql --help\nscripts/pgsql --help\n# Run composer as a service without local installation\nscripts/composer --help\nscripts/composer status\n```\n\nInstall Drupal 8 variant helpers (This delete and replace existing Drupal in `./drupal` folder)\n\n```bash\nscripts/install-drupal.sh\nscripts/install-drupal.sh list\nscripts/install-drupal.sh install -p drupal-demo\n```\n\n## Upgrade\n\nBecause this project is mainly focused on a one time usage, there is currently\n**no upgrade path** and the best way to upgrade is to dump and copy your project to\na new version of this project.\n\n## Suggested tools\n\n- [Opcache GUI](https://github.com/amnuts/opcache-gui)\n- [Phpmemcacheadmin](https://github.com/wp-cloud/phpmemcacheadmin)\n- [Xdebug GUI](https://github.com/splitbrain/xdebug-trace-tree)\n- [Adminer extended](https://github.com/dg/adminer-custom)\n- [Php Redis Admin](https://github.com/ErikDubbelboer/phpRedisAdmin)\n\nYou can find a script for Linux in `scripts/get-tools.sh` folder to download or update all tools\n\n```bash\nchmod +x scripts/get-tools.sh\n./scripts/get-tools.sh install\n```\n\n## Troubleshooting\n\n### General problem\n\nIn case of any problem, first step is to check the configuration and the logs\n\n```bash\ndocker-compose config\ndocker-compose logs\n```\n\n### Port 80\n\nIf you have already a web server running on port __80__ or __443__ on your machine\nyou must stop it or change __APACHE_HOST_HTTP_PORT__ in __.env__\n\n### Windows\n\nWindows support very partial, before running docker-compose you must run in Powershell\n\n```powershell\n$Env:COMPOSE_CONVERT_WINDOWS_PATHS=1\n```\n\nSome permissions and privileged problems\n\n- [This issue](https://github.com/docker/for-win/issues/1829)\n\n----\nWant some help implementing this on your project? I provide Drupal 8 expertise as a freelance, just [contact me](https://developpeur-drupal.com/en).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmogtofu33%2Fdocker-compose-drupal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmogtofu33%2Fdocker-compose-drupal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmogtofu33%2Fdocker-compose-drupal/lists"}