Migrate Drupal Local Environment to Docker/Container

安稳与你 提交于 2021-01-07 01:00:22

问题


Background

I currently have a site that is built using gitlab, composer, vagrant (Drupal-VM) and virtual box, along with other tools like drush, blt, and lighting core. I am new containerization and docker and would like some help in spinning up local environment

TL;DR

From my understanding this means we pretty much spin up a ubuntu vbox that then install a "package" or vagrant box that contains all the tools needed for Drupal, then use blt to start the app. Then drush to handle interacting with the Drupal site.

Problem

Even though these seem like simple steps this process is can be very difficult when you encounter issues with having mismatching version of vagrant, virtual box, php, Drupal versions or even OS upgrade etc..

I have looked into the following possibilities:

  • DDev
  • Drupal-VM-Docker
  • DevDesktop
  • Drupal Docker
  • Drupal VM Docker Composer Plugin
  • Drupal VM Docker
  • Acquia Cloud IDE

Question

How do I migrate to a container and spin up a Drupal image that uses my preexisting code base?


Current Process and Configuration

SITE INFO: Drupal 8.9, PHP 7.3, MySQL 5.x

Current Directory Structure

The process is as follows:

  1. baseline code with develop
  2. composer install
  3. vagrant up
  4. vagrant ssh
  5. blt setup
  6. drush uli -l "local.site.com"
  7. If you make config changes (i.e new fields, views, content types you run drush cex -y)
  8. Then add to code branch and run blt setup one more time to verify its all built cleanly
  9. Then using blt artifact we deploy an artifact to the dev acquia cloud site factor to deploy to dev

回答1:


You can use docker based Drupal stack irrespective of which OS(MAC/Linux/Windows) you want to use.

Github URL: https://github.com/wodby/docker4drupal

You will get containers images for Drupal, MySQL, Varnish, Redis and many more.

Configurations steps are described in quite details here: https://wodby.com/docs/1.0/stacks/drupal/local/#usage



来源:https://stackoverflow.com/questions/65147301/migrate-drupal-local-environment-to-docker-container

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!