Welcome to development team of Marketplace project, This project involves the following technologies:
- PHP 7.3 - using symfony framework
- MySQL 8
- Redis
- MongoDB
- RabbitMQ
- Docker
This service handles stores functionality, including CRUDs, processing and handling all logic related to stores.
- Clone the repository:
git clone git@github.com:Marketplace-Express/shop_stores.git2- Copy ".env.example" file to “.env” under project root directory, then change the parameters to match your preferences, example:
###> doctrine/doctrine-bundle ###
DATABASE_URL=mysql://shop_stores:secret@172.18.0.1:3306/shop_stores?serverVersion=8.0
###< doctrine/doctrine-bundle ###
###> jurry/amqp-symfony-bundle ###
JURRY_RABBIT_MQ_DSN=tcp://guest:guest@172.18.0.1:5672
###< jurry/amqp-symfony-bundle ###
And so on for Redis and RabbitMQ ...
Note: You can use network (marketplace-network) gateway ip instead of providing each container ip
3- Run docker-compose build to build the docker image for this repository.
4- Run docker-compose up -d, This command will create new containers:
- shop_stores_stores-sync_1:
- This will declare a new queue “stores_sync” in RabbitMQ queues list
- shop_stores_stores-async_1:
- This will declare a new queue “stores_async” in RabbitMQ queues list
- shop_stores_stores-api_1:
- This will start a new application server listening on a specific port specified in
docker-compose.ymlfile, you can access it by going to this URL: http://localhost:port - As a default, the port value is 1000.
- You can use Postman with the collections provided to test micro service APIs.
- shop_stores_stores-unit-test_1:
- This will run the unit test for this micro-service
If you want to scale up the workers (sync / async), you can simply run this command:
docker-compose up --scale stores-{sync/async}=num -dWhere “num” is the number of processes to run, {sync/async} is the service which you want to scale up, example:
docker-compose up --scale stores-async=3 -dTo run the unit test, just run this command:
docker-compose up stores-unit-test