Skip to content

Commit e97bb00

Browse files
committed
Docs: Enhance initial-setup README with additional Docker & PGAdmin instructions
1 parent d23a1ba commit e97bb00

File tree

1 file changed

+28
-13
lines changed
  • bootcamp/materials/1-dimensional-data-modeling

1 file changed

+28
-13
lines changed

bootcamp/materials/1-dimensional-data-modeling/README.md

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ For detailed instructions and more information, please refer to the step-by-step
3939

4040
There are two methods to get Postgres running locally.
4141

42+
> **Prefer Docker**
43+
> Unless you want to use a local Postgres install—or must run on bare-metal / low-power hardware—use **Option 2 (Docker)**. It’s easy to reset and leaves your host machine clean.
44+
4245
### 💻 **Option 1: Run on local machine**
4346

4447
1. Install Postgres
@@ -57,14 +60,15 @@ There are two methods to get Postgres running locally.
5760
5861
### 🐳 **Option 2: Run Postgres and PGAdmin in Docker**
5962
60-
- Install Docker Desktop from **[here](https://www.docker.com/products/docker-desktop/)**.
61-
- Copy **`example.env`** to **`.env`**:
63+
1. **Install Docker Desktop** - **[here](https://www.docker.com/products/docker-desktop/)**.
64+
2. Copy **`example.env`** to **`.env`**:
6265
6366
```bash
6467
cp example.env .env
6568
```
66-
67-
- Start the Docker Compose container:
69+
This stores the database credentials, plus email and password used by pgAdmin and Postgres.
70+
71+
3. **Start the Docker Compose stack**:
6872
- If you're on Mac:
6973

7074
```bash
@@ -77,16 +81,25 @@ There are two methods to get Postgres running locally.
7781
docker compose up -d
7882
```
7983
80-
- Two volumes will be created:
81-
- **`1-dimensional-data-modeling_postgres-data`** The data backing your Postgres instance will be saved here.
82-
- **`1-dimensional-data-modeling_pgadmin-data`** The data backing your PGAdmin instance will be saved here.
83-
- You can check that your Docker Compose stack is running by either:
84-
- Going into Docker Desktop: you should see an entry there with a drop-down for each of the containers running in your Docker Compose stack.
85-
- Running **`docker ps -a`** and looking for the containers with the name **`postgres`**.
86-
- If you navigate to **`http://localhost:5050`**, you'll see the PGAdmin instance up and running and should be able to connect to the following server using the details shown below:
87-
84+
Two volumes will be created:
85+
- **`1-dimensional-data-modeling_postgres-data`** The data backing your Postgres instance will be saved here.
86+
- **`1-dimensional-data-modeling_pgadmin-data`** The data backing your PGAdmin instance will be saved here.
87+
88+
4. **Check that your Docker Compose stack is running**:
89+
- **Docker Desktop**: you should see an entry there with a drop-down for each of the containers running in your Docker Compose stack.
90+
- **CLI**: Running **`docker ps -a`** and looking for the containers with the name **`postgres`**.
91+
92+
5. **Open pgAdmin**
93+
- Visit [http://localhost:5050](http://localhost:5050).
94+
*On macOS, Safari works; Firefox can occasionally fail to load this address.*
95+
- Log in with the email and password from your `.env` file.
96+
97+
**First-time pgAdmin set-up**
98+
3. On Default Workspace ➜ Dashboard choose `Add New Server` (under `Quick Links`).
99+
4. `General` tab – give it a friendly name, e.g. `Data-Engineer-Handbook-DB`.
100+
5. `Connection` tab – copy host, port, username and password from `.env`, as shown below:
88101
<img src=".attachments/pgadmin-server.png" style="width:500px;"/>
89-
102+
6. Save ➜ Expand `Servers` › *`your-server`* › `Databases` › `postgres` › `Schemas` › `public` › `Tables` – several tables should be present.
90103
91104
- When you're finished with your Postgres instance(required in week 1 & 2 & 4), you can stop the Docker Compose containers with:
92105

@@ -96,6 +109,8 @@ There are two methods to get Postgres running locally.
96109

97110
## :three: **Connect to Postgres in Local Database Client**
98111

112+
> If you used **Option 2**, you can ignore this section; pgAdmin already gives you a web-based client.
113+
99114
- Some options for interacting with your Postgres instance:
100115
- DataGrip - JetBrains; 30-day free trial or paid version
101116
- VSCode built-in extension (there are a few of these).

0 commit comments

Comments
 (0)