Move to docker directory
cd infra/docker
Copy .env
cp dist.env .env
Build
docker-compose build --pull
docker-compose up -d
Add to /etc/hosts
127.0.0.1 lfp-api.loc
Composer install
docker exec -it lfp-api-php /bin/bash
cd api
composer install
exit
Create database
docker exec -it lfp-api-db mysql -e "CREATE DATABASE IF NOT EXISTS lfp"
docker exec -it lfp-api-db mysql -e "GRANT ALL ON lfp.* TO 'lfp'@'%' IDENTIFIED BY 'lfp'"
docker exec -it lfp-api-php php api/bin/console doctrine:schema:update --force
Populate database with random data. After execute de command, write yes and press enter.
docker exec -it lfp-api-php php api/bin/console doctrine:fixtures:load
For executing tests.
docker exec -it lfp-api-php /bin/bash
cd api
./bin/phpunit
exit
You can show some data visiting:
http://lfp-api.loc/api/clubs
http://lfp-api.loc/api/clubs/1
http://lfp-api.loc/api/clubs/1/players
http://lfp-api.loc/api/players
http://lfp-api.loc/api/players/1
http://lfp-api.loc/api/coaches
http://lfp-api.loc/api/coaches/1
For testing the web services, you can use the LFP.postman_collection.json located in:
cd ../../api/data
Postman is a HTTP client for testing web services. You can download it from https://www.getpostman.com/
For importing the file, you should go to the top right and press "Import", after this, you should add the LFP.postman_collection.json.
You have to press in the gear of top right and then, click on "Add".
Add the next values and save.
Go to the selector on top right and select LFP (the enviroment name that you set in the last step)
Select a service from the list of left side and press "Send" in the top right




