понедельник, 30 апреля 2018 г.

Drupal development docker compose

Docker is very appealed technology. There are a lot of reason to study it for developers. It really simplifies the production/development environment with their dependencies. I used docker for deploying outbox solutions, this way I provided clients with changes. It seems that is mature modular system that makes to think structurally. There are a lot of articles how to use docker in development. But It looks like more to how to get started.


Their skip the main requirement, how to synchronize development sources between guest containers and host machine. I will disclose it. There are few approaches: docker volume driver, different network tools, mixed another solutions. I have been looking for a long time. The result consists of few lines.

Docker volume driver

volumes:
- type: bind
    source: "${PROJECT_PATH}"
    target: /var/www/html
      bind:
        propagation: shared

To understand this better you need be introduced with: Docker volumes and Configure bind propagation

Different network tools, mixed another solutions

This approaches based on network tools such as ftp, sshfs and specific plugins created for docker.
I did it for drupal development needs. This is a gist that modifies the project docker4drupal. It sets up the drupal project in containers and synchronizes code changes from the host machine to guest containers.

Комментариев нет:

Отправить комментарий