Skip to content

Commit

Permalink
chore: wip pgadmin
Browse files Browse the repository at this point in the history
  • Loading branch information
kasir-barati committed Nov 12, 2024
1 parent bab0bbc commit 224fe4a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
19 changes: 16 additions & 3 deletions docker-compose-files/postgres/postgres-pgadmin/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
# How to use?

1. `cp .env.example .env`
2. `mkdir pgdata`
3. `docker compose up`
1. `cp .env.example .env`.
2. `docker compose up -d`.

# How to connect to you DB in your pgadmin4?

## Using `servers.json` config file

- The most easiest way to do this.
- It configures your server connection to your DB automatically for you.
- There are certain limitations. learn more here: https://github.com/pgadmin-org/pgadmin4/issues/8117#issuecomment-2469921653.
- Documented here: https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html#mapped-files-and-directories.
- You can also pre-configure things like theme to dark if you like through `preferences.json` but it is not working for me. Learn about its schema here: https://www.pgadmin.org/docs/pgadmin4/latest/preferences.html#updating-preferences-preferences-json.
- You can see `servers.json` schema here: https://www.pgadmin.org/docs/pgadmin4/latest/import_export_servers.html#json-format.
- Here we are passing the password through docker secrets.

— [Ref](https://stackoverflow.com/a/77519799/8784518).

## The usual way

1. Add New Server
2. Give it a name (It can be anything)
3. Go to the second tab (Connection)
Expand Down
3 changes: 2 additions & 1 deletion docker-compose-files/postgres/postgres-pgadmin/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin
ports:
- "${PGADMIN_EXPOSED_PORT}:80"
- ${PGADMIN_EXPOSED_PORT}:80
configs:
- source: servers.json
target: /pgadmin4/servers.json
Expand Down Expand Up @@ -56,6 +56,7 @@ configs:
"SSLMode": "prefer",
"BGColor": "#FF4500",
"FGColor": "#222222",
"PassFile": "/pgpass",
"Comment": "This server will connect to the instance we've created in our compose file."
}
}
Expand Down

0 comments on commit 224fe4a

Please sign in to comment.