The ZAC Docker Compose setup runs various services required by ZAC and optionally can also run ZAC itself as a Docker container. It was created to be able to run ZAC locally for development and testing purposes. For general ZAC installation instructions please see the INSTALL.md file.
The setup consists of a docker-compose.yml file as well as various data import scripts.
This setup was initially based on https://github.com/generiekzaakafhandelcomponent/gzac-docker-compose and credits go out to Valtimo for this. It was extended and made specific for the needs of ZAC.
- Docker Desktop
- Docker Compose
- 1Password CLI extensions (optional)
- On Windows: to run .sh scripts use git bash
- On Linux: run setup-linux.sh script
This starts up all required services (like Keycloak, Open Zaak, etc) but does not start ZAC itself. From the root folder of this repository execute the following command:
./start-docker-compose.sh
This will run Docker Compose (using docker compose up -d
) and uses the 1Password CLI extensions
to retrieve certain environment variables from 1Password.
Please see the Docker Compose file for the services that will be started. Note that it may take a while for all services to start up completely. You can check the logs of the various Docker containers if you want to see the status.
Please consult the help of the start-docker-compose.sh
script for more options including the option to also
start up ZAC or even build the ZAC Docker Image first beforehand:
./start-docker-compose.sh -h
Currently, our ZAC Docker Compose file contains a reference to a specific version of the ZAC Docker image.
In order to use the latest ZAC Docker Image you can specify a ZAC Docker Image by setting the ZAC_DOCKER_IMAGE
environment variable.
You can find the latest released version of the ZAC Docker Image on:
https://github.com/infonl/dimpact-zaakafhandelcomponent/pkgs/container/zaakafhandelcomponent
Note that it takes some time for ZAC to start up completely. You can see progress by checking the ZAC Docker container logs:
docker logs -f zac
This section contains some specific information about some of the Docker containers used in our Docker Compose setup.
ZAC requires a PostgreSQL database with two database schemas. This is automatically created by the Docker Compose file. If you need to manually insert or change data in the ZAC database:
- Using a PostgreSQL database client connect to the ZAC database using
jdbc:postgresql://localhost:54320/zac
- Log in using the database admin credentials that can be found in the Docker Compose file.
- You should see the following database schemas:
zaakafhandelcomponent
flowable
- After ZAC has started up the first time it should have created the required database tables and initial data.
The Keycloak configuration required by ZAC is automatically imported using the included JSON realm file.
To log in to the Keycloak Admin Console:
- Go to: http://localhost:8081/auth/admin
- Log in with the Keycloak admin credentials that can be found in the Docker Compose file.
ZAC uses the imported zaakafhandelcomponent
Keycloak realm.
After making changes in Keycloak you can make a new realm export thereby overriding the existing realm.json
file to
be automatically imported.
When you do so beware of the following:
- Make sure to select
Export groups and roles
andExport clients
in the export dialog. - After you have exported the realm JSON file make the following manual changes in the file:
- In the LDAP configuration set the dummy value of the
bindCredential
attribute toadmin
. This is because the Keycloak export realm functionality does not export secrets like this. - Do the same for the
secret
attribute in thezaakafhandelcomponent
client configuration and set this to:keycloakZaakafhandelcomponentClientSecret
.
- In the LDAP configuration set the dummy value of the
All required roles are already included in the Keycloak realm. No need to create them manually.
- Apart from the Keycloak admin user, the following test users are included in OpenLDAP
testuser1
- OpenLDAP also contains the following groups:
test-group-a
- You can sync these LDAP users and groups into Keycloak from the User Federation section in the Keycloak Admin Console.
- For now first you need to manually set the
Bind Credential
inUser Federation
-ldap
. This is not imported from the JSON realm file yet. - Now select
Synchronize all users
. - Then in
Mappers
-Groups
selectSync LDAP Groups To Keycloak
. - Make sure that all imported users at least have the
zaakafhandelcomponent_user
role assigned. - For a ZAC admin the following user roles are required:
zaakafhandelcomponent_user
beheerder
domein_elk_zaaktype
OpenLDAP is used by ZAC to authenticate users and to retrieve group information.
ZAC requires OpenLDAP to have the additional RFC2307BIS LDAP schema (e.g. for the GroupOfUniqueNames
object class).
You can use an LDAP client such as Apache Directory Studio to create users and groups and update the zac-ldap-setup.ldif
file.
To do the latter, connect Apache Directory Studio to your local OpenLDAP server on localhost:1389
and then right-click on the dc=example,dc=org
section and select Export - LDIF Export...
.
ZAC requires that each user is part of an (LDAP) group where the uniqueMember
attributes in this group use the cn
attribute to identify a member and not the uid
.
E.g.: uniqueMember: cn=testuser1,ou=people,dc=example,dc=org
.
Note that at the moment ZAC only allows one DN which is used for both users and groups.
The LDIF import contains a number of test users which can be used to log in to ZAC. You may wish to change the email addresses of the test users to your own domain.
Basic configuration required by ZAC is automatically imported into the Open Klant database from the Docker Compose file. Also, a superuser account for the Open Klant UI on http://localhost:8002 is created automatically with username 'admin' and password 'admin'.
- Stop ZAC (only if you are running ZAC separately and not as part of the Docker Compose setup)
- Stop all Docker containers by executing the command:
./stop-docker-compose.sh
from the root folder of this project.
We use Docker volumes to persist data between restarts of certain Docker containers in order to speed up subsequent startups.
Sometimes it is needed to clean up these volumes to start with a clean slate.
To do so run the Docker Compose start script with the -d
option:
./start-docker-compose.sh -d