PhalDock helps you to run your Phalcon app on Docker quickly and with ease.
PhalDock strives to get closer to developers, providing flexible, powerful and simple tools. We would like a Phalcon development process to be effortless and pleasant. It contains pre-packaged Docker images that provides you a wonderful development environment without requiring you to install PHP, NGINX, MySQL, Redis or any other software on your local machine.
Usage overview: Run NGINX
, MySQL
and Redis
.
docker-compose up nginx mysql redis
Before you can use PhalDock you have to install Docker. Go to Dockers installation page and select your OS.
Next you have to decide what setup that best suits your workflow.
A single project setup means that each project has its own Docker environment. You would then access your project from http://127.0.0.1
or http://localhost
. The hierarchy would look like the following example.
- projects
- project1
- docker
- project 2
- docker
- project 3
- docker
Before you decide your setup, have a look at the multiple projects setup.
Clone this repository to your projects root directory.
git clone https://github.com/phalcongelist/phaldock.git
Now we are done. Yep, it's that easy. Have a look at the Usage section to find out how to proceed.
A multiple projects setup means that you have multiple projects that share the same Docker environment. If you're developing applications that depends or communicates with each other this may be a good way to achieve it. This approach makes it possible to access each project as http://project1.dev
or http://whatever.you.prefer
. The hierarchy would look like the following example.
- projects
- docker
- project1
- project 2
- project 3
Before you decide your setup, have a look at the single project setup.
Clone this repository to anywhere.
git clone https://github.com/phalcongelist/phaldock.git
Go to the phaldock folder and open docker-compose.yml
. Edit the applications
service and map your projects.
application:
build: ./application
volumes:
- ../project1:/var/www/project1
- ~/projects/project2:/var/www/project2
- /Users/you/projects/project3:/var/www/project3
Now copy nginx/sites/sample.conf.example
and name the file to something like project1.conf
. You need a new configuration file for each project.
Open each of your newly created configuration files and edit server_name
and root
to something like the following.
server_name project1.dev;
root /var/www/project1/public;
As a final step you have to add your project domains to your hosts
file.
127.0.0.1 project1.dev
127.0.0.1 project2.dev
127.0.0.1 project3.dev
Are you having trouble finding your hosts file?
OS | Path |
---|---|
Linux | /etc/hosts |
Mac OS X | /etc/hosts |
Windows | %SystemRoot%\System32\drivers\etc\hosts |
Let's start by going to your phaldock
folder.
The following example is a very basic example with NGINX and MySQL. The workspace
and php-fpm
container runs automatically in most cases, so there's no need specify them.
docker-compose up nginx mysql
It's easy to switch out and add more containers.
docker-compose up nginx mariadb redis beanstalkd
You can run Docker in the background by adding -d
after up
.
docker-compose up -d nginx mariadb redis beanstalkd