to run this project, please kindly clone/download the repository
before proceeding further.
Note: Please ensure you have docker
installed on your system.
-
Setup
.env
file inside thenews-aggregator-laravel-api
folder, you can get all the value fromenv.example
for your convenience. -
Execute the following command in your terminal:
docker-compose build --no-cache
After finished, proceed to execute
docker-compose up
and wait for the programs to start. (please note that this might take a while)
- Open another terminal, execute
docker-compose exec laravel sh
followed by
php artisan migrate
to migrate all the migration scripts to your mysql database on the container
- Open
http://localhost:3000
to 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