# 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-businesscentral:7.0.0 image.

FROM jboss-eap-7/eap71:7.1.2

# Environment variables
ENV \
    BUSINESS_CENTRAL_DISTRIBUTION_ZIP="rhpam-7.0.0.GA-business-central-eap7-deployable.zip" \
    JBOSS_IMAGE_NAME="rhpam-7/rhpam70-businesscentral" \
    JBOSS_IMAGE_VERSION="7.0.0" \
    JBOSS_PRODUCT="rhpam-businesscentral" \
    PRODUCT_VERSION="7.0.0" \
    RHPAM_BUSINESS_CENTRAL_VERSION="7.0.0" 

# Labels
LABEL \
      architecture="x86_64"  \
      com.redhat.component="rhpam-7-rhpam70-businesscentral-container"  \
      description="Red Hat Business Central 7.0 container image"  \
      io.cekit.version="2.0.0rc4"  \
      name="rhpam-7/rhpam70-businesscentral"  \
      org.concrt.version="2.0.0rc4"  \
      org.jboss.product="rhpam-businesscentral"  \
      org.jboss.product.rhpam-businesscentral.version="7.0.0"  \
      org.jboss.product.version="7.0.0"  \
      summary="Red Hat Business Central 7.0 container image"  \
      version="7.0.0" 

# Exposed ports
EXPOSE 8001

USER root

# Add all artifacts to the /tmp/artifacts
# directory
COPY \
    rhpam-7.0.0.GA-business-central-eap7-deployable.zip \
    /tmp/artifacts/

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

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

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

USER 185



CMD ["/opt/eap/bin/standalone.sh", "-b", "0.0.0.0", "-c", "standalone.xml"]
