We will be getting up Postgres and a simple script to run as containers using docker compose.
cd DevOps-Workshop1
docker compose up -d
- Login to database container as a postgres user.
docker exec -itu postgres workshop_postgres bash
- Login to postgres
cd # this will amke the directory to postgres users home directory
psql # To login to postgres
- Create a database
CREATE DATABASE e_commerce;
- Dump schema.sql file to e_commerce database
psql -U postgres -d e_commerce < /var/lib/schema/schema.sql