Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 640 Bytes

script_1.md

File metadata and controls

42 lines (34 loc) · 640 Bytes

Running scripts using docker compose

We will be getting up Postgres and a simple script to run as containers using docker compose.

Run Docker Compose

cd Search-Workshop1
docker-compose up

Working with database.

  1. Login to database container.
docker exec -it ws1_db sh
  1. Login to postgres
psql -U postgres
  1. Create a database
CREATE DATABASE student;
\q
  1. Dump student.sql file to student database
psql -U postgres -d student < sql_file/student.sql

Running script

  1. Login to script container.
docker exec -it ws1_script sh
  1. Run script:
python3 script.py