|
| 1 | +# Microservices |
| 2 | + |
| 3 | +## Project Steps |
| 4 | + |
| 5 | +1. Created Dockerfile for php - this enables the install and enable of specific tools: vi, pdo, xdebug |
| 6 | + |
| 7 | +Note: This would require changes for deployment as Postgres saves credentials based on OS anyone who accesses the container is able to make changes, this would require additional authentication along with the removal of `bash` from the used images to prevent unwarranted access to the container. |
| 8 | + |
| 9 | +2. Created `docker-compose.yml` in this file the containers are set up (see README.md in root). |
| 10 | + |
| 11 | +This is conducted to ensure the environment is reproducible. In this example I modified the LAMP stack I usually use to instead utilise postgres over MySQL, along with the addition of containers for additional technologies: RabbitMQ. |
| 12 | + |
| 13 | +3. Created docker volume - this is a workaround, usually I would add a volume in the compose file linked to a directory within the root, this folder would be ignored by .gitignore, however, postgres does not allow for this, instead, the data is persisted in a volume and the database populated through a .sql file. |
| 14 | + |
| 15 | +4. Created SQL for creation of database, and data population. |
| 16 | + |
| 17 | +5. Created Models for the database tables |
| 18 | + |
| 19 | +6. Create Controllers for each model. |
| 20 | + |
| 21 | +Utilising object oriented programming each of these is done through a class, due to some issues, mentioned below, this is the further milestone in a 2 hour period. |
| 22 | + |
| 23 | +## Occuring Issues |
| 24 | + |
| 25 | +1. Postgres does not allow dir/data:db/data - workaround to use a docker volume instead. |
| 26 | + |
| 27 | +2. Postgres security concern - this would have to be rectified in a deployment image to ensure only warranted access is permitted due to postgres policies. |
| 28 | + |
| 29 | +3. RabbitMQ starts without enabled plugins - as a workaround a enabled file was created and added via the volume: `./rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins` to ensure the necessary plugins were enabled at startup. |
| 30 | + |
| 31 | +## Next |
| 32 | +In continuation of this project I would first set up controllers for each model, furthermore I would first focus on developign the foreign service to send data to the microservice. |
| 33 | + |
| 34 | +From here the microservice should then check the received payload type, this should then route the informaiton to the correct microservices only. Using RabbitMQ this service would be the producer, the other services would act as consumers picking up the information from RabbitMQ based on the provided ruleset. |
| 35 | + |
| 36 | +More experience is required utilising RabbitMQ and Lumen before stepping to the next section. As such, I will continue working on these skills as I have not experienced these technologies before now. |
| 37 | + |
1 | 38 | # Lumen PHP Framework |
2 | 39 |
|
3 | 40 | [](https://travis-ci.org/laravel/lumen-framework) |
|
0 commit comments