# 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 rhdm-7-tech-preview/rhdm71-decisioncentral-indexing-openshift:1.1 image.

FROM rhdm-7/rhdm71-decisioncentral-indexing:latest

# Environment variables
ENV \
    JBOSS_IMAGE_NAME="rhdm-7-tech-preview/rhdm71-decisioncentral-indexing-openshift" \
    JBOSS_IMAGE_VERSION="1.1" 

# Labels
LABEL \
      com.redhat.component="rhdm-7-rhdm71-decisioncentral-indexing-openshift-container"  \
      description="Red Hat Decision Central Indexing 7.1 OpenShift container image"  \
      io.cekit.version="2.1.4"  \
      io.k8s.description="Platform for running Red Hat Decision Central Indexing"  \
      io.k8s.display-name="Red Hat Decision Central Indexing 7.1"  \
      io.openshift.expose-services="9200:http,9300:tcp"  \
      io.openshift.tags="javaee,rhdm,rhdm7"  \
      name="rhdm-7-tech-preview/rhdm71-decisioncentral-indexing-openshift"  \
      org.concrt.version="2.1.4"  \
      summary="Red Hat Decision Central Indexing 7.1 OpenShift container image"  \
      version="1.1" 

# 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/jboss.kie.workbench-indexing/configure.sh" ]

USER root
RUN [ "bash", "-x", "/tmp/scripts/java-alternatives/run.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 rm -rf /tmp/scripts

USER 185



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

