When it comes to build an iris image, we can use the cpf merge files.
Here is an cpf merge example:
[Actions]
CreateDatabase:Name=IRISAPP_DATA,Directory=/usr/irissys/mgr/IRISAPP_DATA
CreateDatabase:Name=IRISAPP_CODE,Directory=/usr/irissys/mgr/IRISAPP_CODE
CreateNamespace:Name=IRISAPP,Globals=IRISAPP_DATA,Routines=IRISAPP_CODE,Interop=1
ModifyService:Name=%Service_CallIn,Enabled=1,AutheEnabled=48
CreateApplication:Name=/frn,NameSpace=IRISAPP,DispatchClass=Formation.REST.Dispatch,AutheEnabled=48
ModifyUser:Name=SuperUser,PasswordHash=a31d24aecc0bfe560a7e45bd913ad27c667dc25a75cbfd358c451bb595b6bd52bd25c82cafaa23ca1dd30b3b4947d12d3bb0ffb2a717df29912b743a281f97c1,0a4c463a2fa1e7542b61aa48800091ab688eb0a14bebf536638f411f5454c9343b9aa6402b4694f0a89b624407a5f43f0a38fc35216bb18aab7dc41ef9f056b1,10000,SHA512
The cpf merge file is a text file with for example a set of actions.
Here we create two databases, one namespace, we enable the CallIn service, create an web application and we create a user.
The cpf merge file can be executed when iris starts using this environment variable:
ISC_CPF_MERGE_FILE=/tmp/iris.cpf
It can be useful to make use of this environment variable to build an iris image.
Here is an example of Dockerfile:
ARG IMAGE=intersystemsdc/iris-community:latest
FROM $IMAGE as builder
WORKDIR /irisdev/app
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /irisdev/app
USER ${ISC_PACKAGE_MGRUSER}
COPY . /irisdev/app
ENV ISC_CPF_MERGE_FILE=/irisdev/app/merge.cpf
RUN iris start IRIS \
&& iris session IRIS < /irisdev/app/iris.script \
&& iris stop IRIS quietly
During the build when this iris start IRIS command is executed, the cpf merge file is executed.
Hope this helps.
💡 This article is considered InterSystems Data Platform Best Practice.