to run this project, please kindly clone/download the repository before proceeding further.
Note: Please ensure you have docker installed on your system.
-
Setup
.envfile inside thenews-aggregator-laravel-apifolder, you can get all the value fromenv.examplefor your convenience. -
Execute the following command in your terminal:
docker-compose build --no-cacheAfter finished, proceed to execute
docker-compose upand wait for the programs to start. (please note that this might take a while)
- Open another terminal, execute
docker-compose exec laravel shfollowed by
php artisan migrateto migrate all the migration scripts to your mysql database on the container
- Open
http://localhost:3000to browse through the news-aggregator application!
PS:
If you are encountering [SQL] Connection Refused error when hitting an endpoint, make sure to follow the .env.example file or other settings on your machine.
If the issue persist, execute docker-compose ps and copy the mysql container name to and execute the followings
docker inspect <container_name>copy the value from "IpAddress" and replace the value inside .env DB_HOST