Skip to content

This project provides a Docker Compose setup to run PostgreSQL and pgAdmin containers, making it easy to follow along with the "Practical SQL 2nd Edition" book. Includes configuration for datasets and user management.

Notifications You must be signed in to change notification settings

Hectormalvarez/practicalsql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PracticalSQL docker-compose project

This project contains Docker Compose configuration for running PostgreSQL and pgAdmin instances to follow along with the Practical SQL 2nd Edition book.

Configuration

Environment Variables

To configure the services, copy the .env.sample file to .env and set the following variables:

POSTGRES_USER=USERNAME
POSTGRES_PASSWORD=PASSWORD
POSTGRES_DB=DATABASE-NAME
PGADMIN_DEFAULT_EMAIL=LOGIN-EMAIL
PGADMIN_DEFAULT_PASSWORD=LOGIN-PASSWORD
PGADMIN_USER_FOLDER=LOGIN-EMAIL-NO-AT

Datasets

Ensure that datasets are stored in the correct folder:

./datasets:/data

Ensure correct permissions for the dataset folder:

sudo chmod -R 777 /home/USERNAME/practicalsql/datasets

Services

PostgreSQL

Runs the PostgreSQL database server.

  • Image: postgis/postgis:13-3.4-alpine
  • Volumes:
    • Postgres data: postgres-data:/var/lib/postgresql/data
    • Dataset access: ./datasets:/data

pgAdmin

Runs the pgAdmin web interface.

  • Image: dpage/pgadmin4
  • Ports: 8080:80
  • Depends on: postgres

Usage

To start the services, run:

docker-compose up -d

To stop the services, run:

docker-compose down

About

This project provides a Docker Compose setup to run PostgreSQL and pgAdmin containers, making it easy to follow along with the "Practical SQL 2nd Edition" book. Includes configuration for datasets and user management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published