ezimuel / php-microservices-workshop

Source code of Developing microservices with PHP workshop
BSD 3-Clause "New" or "Revised" License
17 stars 7 forks source link

Developing microservices in PHP using Expressive + Swoole + ELK stack

Install using Vagrant

You can use Vagrant to setup a Linux environment to run the php-microservices-workshop application.

This setup will install the following environment:

In order to run Vagrant you need a VM hypervisor like VirtualBox that can be execute on Win, Mac and Linux operating systems.

To execute the Vagrant box you can use the command as follows:

vagrant up

This will require some times (the first execution). When finished, you can see the application running at localhost:8080 using Swoole.

The project directory in the VM machine is /home/vagrant/php-microservices-workshop.

If you want to connect to the VM you can SSH into it, using the command:

vagrant ssh

If you want to close/stop the VM you can use the following command:

vagrant destroy

Install using Docker

To execute the php-microservices-workshop application using Docker you need to run the following command:

docker-compose up

Manual installation

You need to install the project using composer:

composer install

If you don't have composer installed globally please check this documentation.

Composer will install all the dependencies for this project.

After the installation you need to generate the SQLite database used as example. It can be generated using the following command (from the root of the project):

sqlite3 data/db/users.sqlite < data/db/users.sql

You need to install also Swoole, Elasticsearch, and Kibana.

Enable development mode

If you want to customize the application I suggest to enable the development mode using the following command:

composer development-enable