diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 08b25f3bc..d6d6f0bff 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -59,6 +59,21 @@ To run in a detached (background) mode, just:: $ docker-compose up -d +Developing on Mac OS +-------------------- + +If you are using Mac OS you should be familiar with long timeouts from a filesystem. Sharing files into containers is really slow. To resolve this issue is use an external tool like docker-sync. +First of all you need to install docker-sync:: + + $ gem install docker-sync + +After this, run:: + + $ docker-sync start + +Run composer:: + + $ docker-compose -f local.yml -f local-sync.yml up Execute Management Commands --------------------------- diff --git a/{{cookiecutter.project_slug}}/docker-sync.yml b/{{cookiecutter.project_slug}}/docker-sync.yml new file mode 100644 index 000000000..76f76493f --- /dev/null +++ b/{{cookiecutter.project_slug}}/docker-sync.yml @@ -0,0 +1,11 @@ +version: "2" + +options: + compose-file-path: 'local.yml' + compose-dev-file-path: 'local-sync.yml' + +syncs: + django-sync: + host_disk_mount_mode: 'cached' + src: '.' + sync_excludes: [ '.git', '.idea' ] diff --git a/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst b/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst index af3b826a7..dc3a018cf 100644 --- a/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst +++ b/{{cookiecutter.project_slug}}/docs/pycharm/configuration.rst @@ -25,6 +25,10 @@ Switch to *Docker Compose* and select `local.yml` file from directory of your pr .. image:: images/4.png +If you want to use docker-sync ( mac users only ) you should add also `local-sync.yml` + +.. image:: images/4a.png + Having that, click *OK*. Close *Settings* panel, and wait few seconds... .. image:: images/7.png @@ -44,6 +48,8 @@ After few seconds, all *Run/Debug Configurations* should be ready to use. .. image:: images/f4.png * and many others.. + + Known issues ------------ diff --git a/{{cookiecutter.project_slug}}/docs/pycharm/images/4a.png b/{{cookiecutter.project_slug}}/docs/pycharm/images/4a.png new file mode 100644 index 000000000..8c0e4a11e Binary files /dev/null and b/{{cookiecutter.project_slug}}/docs/pycharm/images/4a.png differ diff --git a/{{cookiecutter.project_slug}}/local-sync.yml b/{{cookiecutter.project_slug}}/local-sync.yml new file mode 100644 index 000000000..db53ec7b0 --- /dev/null +++ b/{{cookiecutter.project_slug}}/local-sync.yml @@ -0,0 +1,10 @@ +version: "3" + +services: + django: + volumes: + - django-sync:/app:nocopy + +volumes: + django-sync: + external: true