NOTE! This section is under development
- Docker (Linux) or Boot2docker (OS X, Windows)
- fig
Download Phundament or clone:
git clone https://github.com/phundament/app.git myapp-fig
cd myapp-fig
Copy fig and Dotenv config to project root:
cp .env-dist .env
You may edit the .env file to update environment parameters.
Note: Values of ENV variables defined in
fig.ymlhave precedence over.env.
To initialize your application run the following commands once:
Note: If you are developing on OS X or Windows, make sure your host-vm is running in VirtualBox Manager or with
boot2docker start.
fig run web composer create-project --prefer-dist
They will make the vendor folder available in your project directory on your host machine.
And sets up the database, along with an admin user.
fig up -d web
To automatically create virtual hosts for your projects, you can use a combination of this nginx-proxy image and the xip.io wildcard DNS service.
First, run the reverse-proxy container like described in its README, before you start web application containers.
docker pull jwilder/nginx-proxy
docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock jwilder/nginx-proxy
This will automatically setup virtual hosts accessible through port 80 on your Docker host. You should now be able to access the application under
Linux
OS X, Windows
On OS X the command
echo $DOCKER_HOSTshould print the IP of your host VM, replace it with192.168.59.103infig.ymland the URLs above, if neccessary.
You can display the application logs with:
fig logs
If you need to access the application in development from another client (eg. mobile devices), you can setup a port forwarding to your host-vm. This is an example how to add port forwarding to VirtualBox VM.
boot2docker stop
VBoxManage modifyvm "boot2docker-vm" --natpf1 "rproxy,tcp,,8001,,80"
boot2docker start
Make sure to update your VIRTUAL_HOST environment variable in fig.yml, replace 192.168.1.102 with the IP address of your machine.
VIRTUAL_HOST: myapp-fig.127.0.0.1.xip.io,myapp-fig.192.168.1.102.xip.io
and restart the containers with fig up -d web.
You can access the application under the following URL
http://myapp-fig.192.168.1.102.xip.io:8001
More information on this topic available at github.com/boot2docker.
You can replace the Phundament 4 Docker container (repository) with your custom base container.