# 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/rhpam70-smartrouter:7.0.1 image.

FROM jboss/openjdk18-rhel7:1.1

# Environment variables
ENV JBOSS_IMAGE_NAME="rhpam-7/rhpam70-smartrouter" \
    JBOSS_IMAGE_VERSION="7.0.1" \
    JBOSS_PRODUCT="rhpam-smartrouter" \
    RHPAM_SMARTROUTER_VERSION="7.0.1" \
    PRODUCT_VERSION="7.0.1" \
    ADD_ONS_DISTRIBUTION_ZIP="rhpam-7.0.1.GA-add-ons.zip" \
    KIE_ROUTER_DISTRIBUTION_JAR="rhpam-7.0-smart-router.jar" 

# Labels
LABEL name="$JBOSS_IMAGE_NAME" \
      version="$JBOSS_IMAGE_VERSION" \
      architecture="x86_64"  \
      com.redhat.component="rhpam-7-rhpam70-smartrouter-container" \
      org.jboss.product="rhpam-smartrouter" \
      org.jboss.product.version="7.0.1" \
      org.jboss.product.rhpam-smartrouter.version="7.0.1" \
      org.concrt.version="1.4.1" \
      description="Red Hat Process Automation Manager Smart Router 7.0 container image" \
      summary="Red Hat Process Automation Manager Smart Router 7.0 container image"

# Exposed ports
EXPOSE 9000

USER root

# Add all artifacts to the /tmp/artifacts
# directory
COPY \
    rhpam-7.0.1.GA-add-ons.zip \
    /tmp/artifacts/

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

# Custom scripts
USER root
RUN [ "bash", "-x", "/tmp/scripts/smartrouter/install" ]

USER root
RUN rm -rf /tmp/scripts
USER root
RUN rm -rf /tmp/artifacts

USER 185



CMD ["/usr/bin/java", "-Dorg.kie.server.router.host=0.0.0.0", "-Dorg.kie.server.router.port=9000", "-jar", "/opt/rhpam-smartrouter/rhpam-7.0-smart-router.jar"]
