- Vagrant >= 1.7.0
If you are working with Git repositories, make sure Git is not changing your line endings to CRLF, because you'll run these files in development in a Linux container. You can find more information about this topic on GitHub.
Download or clone:
git clone https://github.com/phundament/app.git
cd app
Setup your environment
cp .env-dist .env
Get the vendor folder for development like so
vagrant up db
vagrant docker-run web -- composer install --prefer-dist
Note! We manually start the
dbcontainer since it's linked from thewebcontainer.
After initialization and setup you can bring up the containers
vagrant up --no-parallel
Now, you're ready to access the application under
To run your database migrations you have to open a bash in your web container with:
vagrant docker-run -t web -- /bin/bash
On this bash you can run yii with:
./yii migrate
If you need to debug Docker, it is recommended to login to the dockerhost with
OS X Users:
VAGRANT_VAGRANTFILE=Vagrantfile-dockerhost vagrant sshWindows Users:
set VAGRANT_VAGRANTFILE=Vagrantfile-dockerhost && vagrant sshand run
dockerfrom there.If you want to reuse the Vagrant VM for your Docker containers across projects, follow these guidelines
cp build/dockerhost/Vagrantfile \ ~/vagrant-dockerhost/Vagrantfileand update the
docker.vagrant_vagrantfilesetting in yourVagrantfile.
Our Vagrant
vagrant-docker-vmregisters a private network interface with the IP192.168.7.6. If you'd like to use your system docker installation comment thedocker.vagrant_vagrantfilesections in theVagrantfilein the project root folder.
You can also load values from a
fig.ymlinto aVagrantfileif you need to support both setups...require "yaml" fig = YAML.load(File.open(File.join(File.dirname(__FILE__), "fig.yml"), File::RDONLY).read)Assign a parameter from a fig file...
docker.env = { "VIRTUAL_HOST" => fig["api"]["environment"]["VIRTUAL_HOST"] }