# 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/rhdm71-optaweb-employee-rostering:7.1.1 image.

FROM jboss-eap-7/eap71:7.1.4-5.1539812366

# Environment variables
ENV \
    ADD_ONS_DISTRIBUTION_ZIP="rhdm-7.1.1-add-ons.zip" \
    EMPLOYEE_ROSTERING_DISTRIBUTION_WAR="employee-rostering-distribution-7.11.0.Final-redhat-00004/binaries/employee-rostering-webapp-7.11.0.Final-redhat-00004.war" \
    EMPLOYEE_ROSTERING_DISTRIBUTION_ZIP="rhdm-7.1-employee-rostering.zip" \
    JBOSS_IMAGE_NAME="rhdm-7/rhdm71-optaweb-employee-rostering" \
    JBOSS_IMAGE_VERSION="7.1.1" \
    JBOSS_PRODUCT="rhdm-optaweb-employee-rostering" \
    JBOSS_RHDM_OPTAWEB_EMPLOYEE_ROSTERING_VERSION="7.1.1" \
    PRODUCT_VERSION="7.1.1" 

# Labels
LABEL \
      com.redhat.component="rhdm-7-rhdm71-optaweb-employee-rostering-container"  \
      description="Red Hat Business Optimizer OptaWeb Employee Rostering 7.1 container image"  \
      io.cekit.version="2.1.4"  \
      name="rhdm-7/rhdm71-optaweb-employee-rostering"  \
      org.concrt.version="2.1.4"  \
      org.jboss.product="rhdm-optaweb-employee-rostering"  \
      org.jboss.product.rhdm-optaweb-employee-rostering.version="7.1.1"  \
      org.jboss.product.version="7.1.1"  \
      summary="Red Hat Business Optimizer OptaWeb Employee Rostering 7.1 container image"  \
      version="7.1.1" 


USER root

# Add all artifacts to the /tmp/artifacts
# directory
COPY \
    rhdm-7.1.1-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/optaweb-employee-rostering/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-full.xml"]

