Run with Docker

Batch Acquirer releases are also distributed as pre-built Docker images, published via GitHub Packages.

The list of published images is available at the URL:

https://github.com/pagopa/rtd-ms-transaction-filter/pkgs/container/rtd-ms-transaction-filter

Download the Docker image

Use the command docker pull to make the desired image available locally:

docker pull ghcr.io/pagopa/rtd-ms-transaction-filter:latest

After the download the image should be listed on the output for the docker image ls command (example):

docker image ls
REPOSITORY                                 TAG         IMAGE ID       CREATED          SIZE
ghcr.io/pagopa/rtd-ms-transaction-filter   latest       3c2af40f86f8   N  minutes ago   <SIZE>

Create the Java KeyStore file

Make sure a Java KeyStore file has been created as indicated in the paragraph Java KeyStore.

Important: the Docker images use JRE 11 as the runtime environment. Make sure to generate the KeyStore file using a compatible JRE, otherwise you will get errors at runtime (i.e. the keytool binary must come from a JRE 11).

Create an env file

Create a .env file containing the environment variables needed to start the application.

The following is a starting template: you can copy it and fill the placeholders with your customised values.

ACQ_BATCH_SCHEDULED=true
ACQ_BATCH_INPUT_CRON=<CRON_EXPRESSION>
ACQ_BATCH_TRX_INPUT_PATH=/workdir/input_trx
ACQ_BATCH_HPAN_INPUT_PATH=/workdir/input_hpans
ACQ_BATCH_TRX_LOGS_PATH=/workdir/logs
ACQ_BATCH_OUTPUT_PATH=/workdir/output
ACQ_BATCH_SENDER_ADEACK_OUTPUT_PATH=/workdir/ade-errors
HPAN_SERVICE_URL=<API_ENDPOINT>
HPAN_SERVICE_API_KEY=<APIM_KEY>
HPAN_SERVICE_KEY_STORE_FILE=/app/certs.jks
HPAN_SERVICE_KEY_STORE_PASSWORD=<KEYSTORE_PASSWORD>
HPAN_SERVICE_TRUST_STORE_FILE=/app/certs.jks
HPAN_SERVICE_TRUST_STORE_PASSWORD=<KEYSTORE_PASSWORD>
JAVA_TOOL_OPTIONS=-Xms6g -Xmx6g

Choose a work directory to mount

The container needs a working directory which will be bind mounted from the host machine inside the running container. Prepare an empty directory dedicated to the Batch Acquirer and take note of the path. There is no need to create any subdirectory inside the working directory (e.g. for the input transaction files): required directories will be created on-the-fly by the container itself.

Run the container

Run the container with docker run:

docker run -d \
    --restart always \
    --env-file <PATH_TO_ENV_FILE> \
    --mount type=bind,source=<LOCAL_WORKDIR>,target=/workdir \
    --mount type=bind,source=<LOCAL_KEYSTORE_PATH>,target=/app/certs.jks \
    ghcr.io/pagopa/rtd-ms-transaction-filter:latest

We suggest to use the --restart always option to ensure that even in case of application error the container will be automatically restarted.

Last updated