<commit_before>Docker containers with Vagrant
------------------------------

> **Note! This section is under development and requires at least `Vagrant >= 1.7.0-dev`**

### Initialize

> #### Windows and OS X Users Only
>
> Recommended first time setup with a dedicated `dockerhost-vm` for Vagrant:
>
> ```
> cp ./platforms/vagrant-docker/dockerhost-vm/Vagrantfile \
>    ~/dockerhost-vm/Vagrantfile
> ```
>
> And set your environment variable `DOCKER_HOST_VAGRANTFILE=~/dockerhost-vm/Vagrantfile`.
> For some Vagrant versions you may also need to set `DOCKER_TLS_VERIFY=0`.
>
> **Please also make sure to start your `dockerhost-vm` manually _before_ starting the Docker containers:**
>
> ```
> cd ~/dockerhost-vm
> vagrant up
> ```

Setup the app:

    cp .env-dist .env
    cp ./platforms/vagrant-docker/Vagrantfile .

### Run

    vagrant up db --provider=docker
    vagrant up backend --provider=docker
    vagrant up frontend --provider=docker

### Setup

    vagrant docker-run backend -- composer install --prefer-dist
    vagrant docker-run backend -- ./yii app/setup --interactive=0
<commit_msg>Update 51-vagrant-docker.md<commit_after>Docker containers with Vagrant
------------------------------

> **Note! This section is under development and requires `Vagrant >= 1.6.5-dev`**

### Initialize

> #### Windows and OS X Users Only
>
> Recommended first time setup with a dedicated `dockerhost-vm` for Vagrant:
>
> ```
> cp ./platforms/vagrant-docker/dockerhost-vm/Vagrantfile \
>    ~/dockerhost-vm/Vagrantfile
> ```
>
> And set your environment variable `DOCKER_HOST_VAGRANTFILE=~/dockerhost-vm/Vagrantfile`.
>
> ```
> cd ~/dockerhost-vm
> vagrant up
> ```

Setup the app:

    cp .env-dist .env
    cp ./platforms/vagrant-docker/Vagrantfile .

**Since Vagrant <=1.6.5 has issues, with simulateous Docker containers, we recommend to start only the `db` container first, to bring up the `dockerhost-vm` _before_ starting the rest of the Docker containers:**

    vagrant up db --provider=docker

When the database container is running, initialize the application and setup the the database:

    vagrant docker-run backend -- composer install --prefer-dist
    vagrant docker-run backend -- ./yii app/setup --interactive=0

### Run

After initialization and setup you can bring up the containers:

    vagrant up backend --provider=docker
    vagrant up frontend --provider=docker

> #### Windows and OS X Users Only
>
> Our Vagrant `dockerhost-vm` registers a private network interface with the IP `192.168.7.6`, we recommend setting up a entry in `/etc/hosts` with `192.168.7.6 doccker.vagrant`

Now, you're ready to access the [frontend application](http://docker.vagrant:22280) or [backend application](http://docker.vagrant:22281).

{'fraction_non_alphanumeric': 0.13677700982175336, 'fraction_numerical': 0.014550745725718442, 'mean_word_length': 3.4715447154471546, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6405318', 'n_tokens_mistral': 904, 'n_tokens_neox': 857, 'n_words': 278}