Multiple API projects in a single workspace with Docker Desktop

Learn how to switch between multiple API projects in a single workspace.

zosConnect-3.0 Applies to zosConnect-3.0.

Containers Applies to z/OS Connect container deployments.

The example commands in the following procedure use docker. If you are using Podman as your container platform, use podman instead of docker in the example commands.

When using Docker Desktop with the IBM® z/OS® Connect Designer, it is possible to have multiple API projects that are defined within a single workspace as shown in the following workspace directory structure.

/workspace
|-- docker-compose.yaml
|-- /logs
|-- /certs
|-- /apiProject1
|-- /apiProject2

You might want to switch between API projects during development time. For example, both apiProject1 and apiProject2 use the same security credentials that are stored in /certs or all API project logs must be kept in a single /logs directory. This can be achieved by editing which API project is commented out within the docker-compose.yaml file.

In the following sample docker compose file, there are two API projects that are defined within the volumes object in the docker-compose.yaml file.

# - ./apiProject2:/workspace/project is commented out with the # character and is ignored when the z/OS Connect Designer is instantiated.

version: "3.2"
services:
    zosConnect:
        image: icr.io/zosconnect/ibm-zcon-designer:3.0.100
        environment:
            - CICS_USER=<cicsUsername>
            - CICS_PASSWORD=<cicsPassword>
            - CICS_HOST=<cicsHost>
            - CICS_PORT=<cicsPort>
            - HTTP_PORT=9080
            - zosconnect_remote_download_allowlist=BLOCK_ALL
        ports:
            - "9442:9443"
            - "9080:9080"
        volumes:
            - ./apiProject1:/workspace/project
            # - ./apiProject2:/workspace/project
            - ./logs/:/logs/
            - ./certs:/config/resources/security/:ro

Upon entering the command docker compose up -d in the root of your workspace, the z/OS Connect Designer starts with the API project that is not commented out being mounted into the running container. In the docker-compose.yaml, - ./apiProject1:/workspace/project is mounted into the z/OS Connect Designer.

For more information about allowlist property, see Configuring an allowlist for IBM z/OS Connect Designer.

Figure 1. Using multiple API projects in a workspace
Architecture image shows how commenting out a volume entry in the docker-compose.yaml, you can have multiple z/OS Connect API projects in one workspace.
Note: You can only have 1 API project in the running z/OS Connect Designer at any time. Ensure that only 1 API project is mounted in the docker-compose.yaml file.

When switching between API projects, ensure that you stop the running container with docker compose down before editing the docker-compose.yaml file.