This repository contains a docker-compose file for running PostgreSQL on your localhost. With this project a python script is shipped that installs the popular Northind Database for demo/learning purposes.
The project was tested with the following software components...
Name | Reference |
---|---|
Windows | >= 11 |
Python | >= 3.11.3 |
Docker Desktop | >= 4.12.0 |
WSL | >= 2 |
Ubuntu | >= 20.04.6 LTS (Focal Fossa) |
docker | 20.10.17 |
docker-compose | v2.10.2 |
-
Open a WSL Terminal Window
-
Clone the Docker-PostgreSQL repo
$ cd $HOME $ git clone https://github.com/schneidermatic/Docker-PostgreSQL.git
-
Switch into the 'Docker-PostgreSQL/stack' folder
$ cd ~/Docker-PostgreSQL/stack
-
Start the container as daemon process
$ docker-compose up -d
-
Sign into the pgAdmin4 web console
http://localhost:5050 Email Address / Username: [email protected] Password: changeme
-
Install Python Libraries
$ cd $HOME/Docker-PostgreSQL/resources/share/scripts $ python -m venv venv $ . ./venv/bin/activate $ pip install -r ./requirements.txt
-
Run the crtdb.py script that installs the Northwind Database.
$ ./crtdb.py Downloaded ../data/northwind_ddl.sql from https://raw.githubusercontent.com/yugabyte/yugabyte-db/refs/heads/master/sample/northwind_ddl.sql Downloaded ../data/northwind_data.sql from https://raw.githubusercontent.com/yugabyte/yugabyte-db/refs/heads/master/sample/northwind_data.sql Executing SQL commands from ../data/northwind_ddl.sql Executing SQL commands from ../data/northwind_data.sql
-
Stop and remove all docker images
$ docker-compose down --rmi all
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request