Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(docker-compose): add optional pgadmin behind profile for zaakbrug postgres db #157

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
}
}
}
Loading