Skip to content

This repository has a docker-compose file that creates tables and fills the tables in a Postgres database.

Notifications You must be signed in to change notification settings

abdibedaso/Docker-Postgres-With-Data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Creating and filling a Postgres DB with Docker Compose

This repository has a docker-compose file that creates tables and fills the tables in a Postgres database. The DDL and DML query's are found inside the sql/ folder

ER Diagram

The ER Diagram of the DB:

ER_Diagram

DB Variables

Set the variables in sql/fill_tables.sql

Parameter Description
number_of_users Number of rows to create in the table users
number_of_coutries Number of rows to create in the table country
number_of_cities Number of rows to create in the table city

Params

If you want to change the postgres params head to in docker-compose.yaml

Parameter Description
POSTGRES_USER The Postgres user to connect postgres
POSTGRES_PASSWORD The Postgres password to connect postgres
POSTGRES_DB The Postgres DB to create postgres
port The port mapped by Postgres is 5432 in your container. In this example, use the port 5438 on the host machine

Run

$ docker-compose up

About

This repository has a docker-compose file that creates tables and fills the tables in a Postgres database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published