# PostgreSQL

## Reference Links

## Configuration

## Docker

### Image

{% embed url="<https://hub.docker.com/_/postgres>" %}

### Compose

```yaml
version: "3.7"
services:
  postgres: # access with `psql -Uuser -h127.0.0.1 -p5432 database -W`
    # image reference: https://hub.docker.com/_/postgres
    image: library/postgres:15.3-alpine
    environment:
      POSTGRES_PASSWORD: password
      POSTGRES_USER: user
      POSTGRES_DB: database
    ports: ["5432:5432"]
    network_mode: host
    volumes: # [] # uncomment this and comment below to remove persistence
      - ./.data/postgres/data/var/lib/postgres/data:/var/lib/postgresql/data
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.joeir.net/application-infrastructure/databases/postgresql.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
