Skip to content

Commit

Permalink
test(docker-compose): add optional pgadmin behind profile for zaakbru…
Browse files Browse the repository at this point in the history
…g postgres db
  • Loading branch information
MLenterman committed Sep 18, 2023
1 parent 6b44ab4 commit a98cc27
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ For example: `docker-compose -f ./docker-compose.zaakbrug.dev.yml -f ./docker-co

> Note: Database data is not seamlessly shared with the Frank!Runner out-off-the-box. In `src/webapp/META_INF/context.xml` you can comment out the H2 configuration and uncomment the Postgress one. The Frank!Runner will then use the Postgres database used in the docker-compose.
#### PgAdmin4
To aid with debugging you can use PgAdmin4 to browse/edit the Postgres database. PgAdmin4 is included and pre-configured in `docker-compose.zaakbrug.postgres` and can be enabled by adding `--profile pgadmin` to your `docker-compose up` command.

The PgAdmin4 web-GUI is exposed on port `5050`, so can be accessed with `localhost:5050` or `host.docker.internal:5050`

**default login:**
email: `[email protected]`
password: `admin`

For example: `docker-compose -f ./docker-compose.zaakbrug.dev.yml -f ./docker-compose.zaakbrug.postgres.yml --profile pgadmin up --build`

## docker-compose.zaakbrug.staging.dev
Contains an instance of OpenZaak specifically configured to act as cache or staging for ZGW to ZDS translations. It shares a network with ZaakBrug, and should be considered a component of the ZaakBrug deployment for when ZGW to ZDS translations are required.
Expand Down
17 changes: 17 additions & 0 deletions docker-compose.zaakbrug.postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ services:
- zaakbrug-backend
volumes:
- zaakbrug-postgres-data:/var/lib/postgresql/data

zaakbrug-pgadmin:
profiles:
- pgadmin
image: dpage/pgadmin4:${PGADMIN_VERSION:-latest}
user: root
command: ["/venv/bin/python3", "/pgadmin4/setup.py", "--load-servers", "zaakbrug-pgadmin-conf.json", "--user", "[email protected]"]
ports:
- 5050:80
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin
networks:
- zaakbrug-stack
- zaakbrug-backend
depends_on:
- zaakbrug-postgres

zaakbrug:
environment:
Expand Down
22 changes: 22 additions & 0 deletions docker/zaakbrug-postgres/zaakbrug-pgadmin-conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"Servers": {
"1": {
"Name": "zaakbrug-postgres",
"Group": "Servers",
"Host": "zaakbrug-postgres",
"Port": 5432,
"MaintenanceDB": "postgres",
"Username": "zaakbrug",
"UseSSHTunnel": 0,
"TunnelPort": "22",
"TunnelAuthentication": 0,
"KerberosAuthentication": false,
"ConnectionParameters": {
"sslmode": "prefer",
"connect_timeout": 10,
"sslcert": "<STORAGE_DIR>/.postgresql/postgresql.crt",
"sslkey": "<STORAGE_DIR>/.postgresql/postgresql.key"
}
}
}
}

0 comments on commit a98cc27

Please sign in to comment.