A straightforward infrastructure-as-code setup for running PostgreSQL with Supabase using Docker.
-
Rename the Project
Replace all instances of
postgres_subapase_iacin files and directories with your desired project name. -
Configure Environment Variables
- Copy
.env.sampleto.env. - Update the connection URI and other settings in
.envas needed.
- Copy
-
Start Docker Containers
docker compose up -d
-
Install Python Dependencies
poetry install
This will install all required dependencies and make the
postgres-supabasecommand available. -
Create Database Tables
Run the following command (as defined in your
pyproject.toml):postgres-supabase create-tables
-
To stop and remove all Docker containers and associated volumes, run:
docker compose down -v