9/20/2023 0 Comments Drupal docker![]() With our project directory reorganized, we can now start adding Docker. Note that we're not only ignoring SQL files, but commonly used compressed files as well. gitignore database dumps in our db-backups directory: # Ignore common database dump files by extension Some of Drupal core and some modules include database dumps for internal testing. We also never want Git to commit a database dump to the repository. Again, since Git only tracks files, we add a. For the purposes of Docker, we want to create a directory within our project to act as a landing site for these database dumps: /path/to/my_projectĪgain, you can call this directory anything, but this series uses db-backups as it's both short and obvious. Part of your workflow will be to import a new database dump into your local development environment. Database dumpsįor most sites, you most likely already have a canonical database on which you develop. keep file to ensure the directory is tracked: /path/to/my_projectįor simplicity, this series assumes you are either tracking all of Drupal core in Git, or that you have already built your site root using Composer. Git doesn't track directories - only files - so we add a. In that case, it's best to create a Git-tracked placeholder directory. If you are using a Composer-based workflow, you may not track all of Drupal core in your repository. For this reason, it's best to maintain a single, unified. gitignore files throughout your project, it can be confusing and cause issues with some Integrated Development Environments (IDEs). ![]() gitignore file allows you to mark directories, files, and file path patterns as ignored by Git. gitignore file in the root of your project directory: /path/to/my_project ![]() It seems obvious, but it's best practice to add a. Git is also an excellent way of distributing code not only with other human beings, but with automated systems for deploying code to stage or production. It reduces the problems of different team members overwriting each others' work. Git allows you to track changes as your project evolves. Not only is it a Drupal development best practice, but Git is the backbone of modern site development. No, really, use version control! Placing your project under a Version Control System (VCS) such as Git brings your project several advantages. There's no hard standard, but hosting services provided by companies such as Acquia and Pantheon may have a preference. Your site root directory can be called anything, although docroot, html, and src are common. For this reason, it's best to organize your project so that the site root is a subdirectory of the project root: /path/to/my_project Each of these should be placed under version control. There are additional configuration files, developer documentation, CHANGELOGs, files to support Behavior Driven Development testing, and other assets. While this can work, it's no longer considered a best practice.Ī Drupal site project is more than just a site root. A very common practice is for the Drupal site root to be the same as the project root. There are several ways to organize your project directory. Ready an existing Drupal site for Docker.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |