We will be running postgres queries using a script.
ENV POSTGRES_HOST='127.0.0.1'
In the above line replace '127.0.0.1' with your local system ip
cd Search-Workshop1
docker build -t "ws1-script2" .
docker run -it ws1-script2:latest bash
- Login to postgres
psql -U postgres --host <system_ip> --port 5435
\q
######Note -> password - postgres
- Create database
CREATE DATABASE amazon;
\q
- Dump schema.sql file to amazon database
psql -U postgres -d amazon --host <system_ip> --port 5435 < src/schema/schema.sql
- Run the script
cd src/app
python3 populate.py