ONGR development environment
Are you tired from Vagrant, virtual machines (Virtualbox, VMware), MAMP, WAMP or whatever is slow and complex to maintain? Then you my friend are in the right place. Introducing you one file* development environment which works on every OS**.
*we do not consider empty directory as a file.
**Windows lacks interactive shell support to what's happening when you execute cli commands.
After up and running you will get:
- PHP FPM 7.0
- Maria DB 10.1
- Elasticsearch 2.4
- You name it..
That said, you can add any container to the
docker-compose.ymlyou want. Or modify by creating a build, more about it read at extending the environment topic below.
Start and run
You need a Docker
We'll gonna use docker. Check out the latest version from official website according to your operating system. By the way, your machine should support Hyper-V to work with docker.
After you install it, you should be able to access CLI
docker-compose is the command what we are going to use here.
Docker pulls images via Git, so make sure you also have Git installed.
Start the engine
The environment is designed that you can paste the content's of this repo to the Symfony project root and you are good to go.
If you want just give a test drive, create a
app_dev.phpfile inside it. This is the file where predefined vhost points to.
All right, enough waiting, let's run some commands:
docker-compose up -d
-dmeans you starting all containers in the background.
How to run
ongr/php-fpm comes with pre-installed container so this container is responsible for this execution.
To pass any command run in the container execute it with
docker-compose exec fpm composer install
docker-compose runcommand, the difference is that this command creates new additional container and executes command in it.
Can I access bash in the container?
Yes. Simply run:
docker-compose exec fpm bash
And you will land in the specific container bash with root permissions.
If something happened first thing to do is to check logs:
Don't forget that you can check specific container logs as well
docker-compose logs mariadb
We always trying to improve our tools and bundles. So the feedback is very important for us to make everything what we are creating better. If something does'nt work as expected or you have any issues that you don't know how to solve, please create an issue.