PostgreSQL is open-source relational database. This PostgreSQL container uses custom pg_hba.conf
and postgresql.conf
files, and a init.sql
script to create some tables and records on startup.
To start the Postgres container, run
docker compose up --detach
Once the container is running, you can access the database using the psql
command-line tool.
PGPASSWORD=postgres psql -h localhost -U postgres -d mydatabase
To stop and remove the containers, run
docker compose down --volumes