/Laravel_Docker_PostgreSQL

A simple project to see the work of docker-compose to run laravel and PostgreSQL in their container

Primary LanguagePHP

STEPS TO RUN THE PROJECT

1) verify that you have docker on your OS
2) verify that you have docker-compose installed on you OS
3) Run the Docker Compose file

Go to the root of the project and run

docker-compose up -d --build

4) Rest of the tutorial

tutorial

5.A)Go to the a terminal to log to the apache container

execute the command the following

  1. Go inside the container

sudo docker-compose exec php-apache /bin/bash

  1. Migrate table

php artisan migrate

  1. Seeding database

php artisan db:seed

image

5.B) Go to another terminal to log to the postgresql docker container

run teh following command

1)login command

sudo docker-compose exec database /bin/bash

  1. login to the postgresql database

psql -U postgres laravel_docker

  1. displaying the database data

SELECT * FROM quotes;

imag

5.B) go to your host domain:8080/quotes

You will see the data for the database