• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

geerlingguy/drupal-for-kubernetes: Drupal Example Site for Kubernetes

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

geerlingguy/drupal-for-kubernetes

开源软件地址(OpenSource Url):

https://github.com/geerlingguy/drupal-for-kubernetes

开源编程语言(OpenSource Language):

PHP 84.2%

开源软件介绍(OpenSource Introduction):

Drupal Example Site for Kubernetes

CI

The purpose of this Drupal codebase is to demonstrate a Drupal project and configuration set up for deployment into Kubernetes or an otherwise scalable containerized environment.

The project is used in tandem with the Raspberry Pi Dramble, an open source Kubernetes cluster tailor made for Drupal meant to run on a cluster of Raspberry Pis.

Documentation

Please read through the project documentation for details about how this project was created, how it's structured for easy development and deployment into production container environments, and how you can create your own Drupal project like it.

Local setup

  1. Build the site's docker image from the Dockerfile:

    docker build -t geerlingguy/drupal-for-kubernetes .
    
  2. Run the local development environment:

    docker-compose up -d
    

    (Wait for the environment to come up—you can monitor the logs with docker-compose logs -f).

  3. Once the container is running, install Dependencies and install Drupal. You can either access http://localhost/ and install using the UI, or install via Drush:

    # Install dependencies.
    docker-compose exec drupal composer install
    
    # Install Drupal.
    docker-compose exec drupal bash -c 'drush site:install minimal --db-url="mysql://drupal:$DRUPAL_DATABASE_PASSWORD@$DRUPAL_DATABASE_HOST/drupal" --site-name="Drupal Example Site for Kubernetes" --existing-config -y'
    
  4. Visit http://localhost/ in your browser, and login as admin using the password Drush printed in the 'Installation complete' message.

Note: If you have PHP and Composer installed on your host computer, you can run the composer install command there instead of through the Docker container for a bit of a speedup. Also note that if you're using Docker for Mac or Windows, it can take a couple minutes after composer install completes for all the filesystem changes to be present inside the Docker container!

Managing Configuration

After making any configuration changes on the website, you can export the configuration to disk so it can be preserved in the codebase and deployed to the production site:

docker-compose exec drupal bash -c 'drush config:export -y'

For more on the way this project's configuration changes are handled, and the general site development process, see the project documentation.

Exporting Content

After making any content changes on the website, you can export the changes to disk so it is preserved in the codebase and installable on the production site:

docker-compose exec drupal bash -c 'drush dcer --folder=modules/custom/pidramble_default_content/content/ node 1'

For more on the way this project's content changes are handled, see the pidramble_default_content README.

Upgrading Core (and Contrib)

  1. Set up the site like normal, make sure it's installed.
  2. Run docker-compose exec drupal composer update (to update everything).
  3. Run docker-compose exec drupal bash -c 'drush updb -y'
  4. Run docker-compose exec drupal bash -c 'drush config:export -y'
  5. Commit any changes and push them.

License

MIT license.

Author Information

Created in 2019 by Jeff Geerling, author of Ansible for DevOps and Ansible for Kubernetes.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap