Fix simulator docker file and startup script
[policy/models.git] / models-sim / packages / models-simulator-docker / src / main / docker / Dockerfile
1 #
2 # ============LICENSE_START=======================================================
3 # ONAP
4 # ================================================================================
5 # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
6 # Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
7 # Modifications Copyright (C) 2022 Nordix Foundation.
8 # ================================================================================
9 # Licensed under the Apache License, Version 2.0 (the "License");
10 # you may not use this file except in compliance with the License.
11 # You may obtain a copy of the License at
12 #
13 #      http://www.apache.org/licenses/LICENSE-2.0
14 #
15 # Unless required by applicable law or agreed to in writing, software
16 # distributed under the License is distributed on an "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 # See the License for the specific language governing permissions and
19 # limitations under the License.
20 #
21 # SPDX-License-Identifier: Apache-2.0
22 # ============LICENSE_END=========================================================
23 #
24
25 FROM onap/policy-jre-alpine:2.4.3
26
27 LABEL maintainer="Policy Team"
28 LABEL org.opencontainers.image.title="Policy Models Simulator"
29 LABEL org.opencontainers.image.description="Policy Models Simulator image based on Alpine"
30 LABEL org.opencontainers.image.url="https://github.com/onap/policy-models"
31 LABEL org.opencontainers.image.vendor="ONAP Policy Team"
32 LABEL org.opencontainers.image.licenses="Apache-2.0"
33 LABEL org.opencontainers.image.created="${git.build.time}"
34 LABEL org.opencontainers.image.version="${git.build.version}"
35 LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
36
37 ARG POLICY_LOGS=/var/log/onap/policy/simulators
38
39 ENV POLICY_LOGS=$POLICY_LOGS
40 ENV POLICY_HOME=$POLICY_HOME/simulators
41
42 RUN mkdir -p $POLICY_HOME $POLICY_LOGS $POLICY_HOME/bin && \
43     chown  -R policy:policy $POLICY_HOME $POLICY_LOGS && \
44     mkdir /packages
45 COPY /maven/lib/models-simulator.tar.gz /packages
46
47 RUN tar xvfz /packages/models-simulator.tar.gz --directory ${POLICY_HOME} \
48     && rm /packages/models-simulator.tar.gz
49
50 WORKDIR $POLICY_HOME
51 COPY simulators.sh bin/.
52
53 RUN chown -R policy:policy * && chmod 755 bin/*.sh && chown -R policy:policy /app
54
55 USER policy
56 WORKDIR $POLICY_HOME/bin
57 ENTRYPOINT [ "./simulators.sh" ]