This project contains Docker Compose configuration for running PostgreSQL and pgAdmin instances to follow along with the Practical SQL 2nd Edition book.
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
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
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
- Postgres data:
Runs the pgAdmin web interface.
- Image:
dpage/pgadmin4
- Ports:
8080:80
- Depends on:
postgres
To start the services, run:
docker-compose up -d
To stop the services, run:
docker-compose down