d66d38761f32939991ce425a1604edee03c6a021
[externalapi/nbi.git] / Dockerfile
1 #
2 #     Copyright (c) 2018 Orange
3 #
4 #     Licensed under the Apache License, Version 2.0 (the "License");
5 #     you may not use this file except in compliance with the License.
6 #     You may obtain a copy of the License at
7 #
8 #         http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #     Unless required by applicable law or agreed to in writing, software
11 #     distributed under the License is distributed on an "AS IS" BASIS,
12 #     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #     See the License for the specific language governing permissions and
14 #     limitations under the License.
15 #
16
17 FROM registry.gitlab.com/onap-integration/docker/onap-java
18
19 USER root
20 COPY src/main/resources/certificate /certs
21 ARG CERT_PASS=changeit
22 RUN for cert in $(ls -d /certs/*); do \
23         echo "adding $cert to java keystore..."; \
24         keytool -import \
25                 -file "$cert" \
26                 -storepass "${CERT_PASS}" \
27                 -keystore $JAVA_HOME/lib/security/cacerts \
28                 -alias "$(basename $cert)" \
29                 --noprompt; \
30     done
31
32 USER onap
33
34 ARG SERVER_PORT
35 ARG PKG_FILENAME=nbi-rest-services-5.0.1-SNAPSHOT.jar
36 ADD target/$PKG_FILENAME /opt/onap/app.jar
37
38 RUN mkdir temptoscafile && chown onap:onap temptoscafile/
39
40
41 ENV SERVER_PORT=${SERVER_PORT:-8443}
42 ENV HTTP_PORT=${HTTP_PORT:-8080}
43 ENV JAVA_OPTS="-Dspring.profiles.active=ssl -Djava.security.egd=file:/dev/./urandom"
44
45 EXPOSE $SERVER_PORT
46 EXPOSE $HTTP_PORT
47 ENTRYPOINT java -XX:+UseContainerSupport $JAVA_OPTS -jar /opt/onap/app.jar