FROM open-liberty:21.0.0.9-full-java8-openj9

#Copy ZIETRans project ear to dropins folder of Liberty server
COPY ZIETRansProjEAR.ear /config/dropins/

#Create a folder with name runtime and copy runtime.properties file inside that folder
RUN mkdir -p /runtime 
ADD runtime.properties /runtime

#Create a folder with name connection and copy main.hco file inside that folder
RUN mkdir -p /connection
ADD main.hco /connection

#Below lines are used to create folder in environemnt variable path to keep runtime.properties outside the ZIETRans EAR
RUN mkdir -p /home/runtime/ZIETRansProj
RUN chmod -R 777 /home/runtime/ZIETRansProj

#Below lines are used to create folder in environemnt variable path to configure main.hco file outside the ZIETRans Project
RUN mkdir -p /home/connection/ZIETRansProj/connections
RUN chmod -R 777 /home/connection/ZIETRansProj/connections

COPY --chown=1001:0 wrapper.sh /
RUN chmod +x /wrapper.sh
COPY --chown=1001:0 copyruntime.sh /
RUN chmod +x /copyruntime.sh

USER 1001
CMD ["sh", "/wrapper.sh"]

