# Copyright 2017 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ------------------------------------------------------------------------
#
# This is a Dockerfile for the rhpam-7-tech-preview/rhpam70-businesscentral-indexing-openshift:1.1 image.

FROM rhpam-7/rhpam70-businesscentral-indexing:latest

# Environment variables
ENV JBOSS_IMAGE_NAME="rhpam-7-tech-preview/rhpam70-businesscentral-indexing-openshift" \
    JBOSS_IMAGE_VERSION="1.1" 
# Labels
LABEL name="$JBOSS_IMAGE_NAME" \
      version="$JBOSS_IMAGE_VERSION" \
      architecture="x86_64"  \
      com.redhat.component="rhpam-7-rhpam70-businesscentral-indexing-openshift-container" \
      io.k8s.description="Platform for running Red Hat Business Central Indexing" \
      io.k8s.display-name="Red Hat Business Central Indexing 7.0" \
      io.openshift.expose-services="9200:http,9300:tcp" \
      io.openshift.tags="javaee,rhpam,rhdm,rhpam7,rhdm7" \
      org.concrt.version="1.4.1" \
      description="Red Hat Business Central Indexing 7.0 OpenShift container image" \
      summary="Red Hat Business Central Indexing 7.0 OpenShift container image"

# Exposed ports
EXPOSE 9200 9300

USER root

# Add scripts used to configure the image
COPY modules /tmp/scripts

# Custom scripts
USER root
RUN [ "bash", "-x", "/tmp/scripts/os.bpmsuite.elasticsearch/configure.sh" ]

USER root
RUN [ "bash", "-x", "/tmp/scripts/os-java-run/install_as_root" ]

USER root
RUN [ "bash", "-x", "/tmp/scripts/dynamic-resources/install.sh" ]

USER root
RUN [ "bash", "-x", "/tmp/scripts/java-alternatives/run.sh" ]

USER root
RUN rm -rf /tmp/scripts

USER 185



CMD ["/opt/elasticsearch/bin/openshift-launch.sh"]
