2 # Copyright (c) 2018 Orange
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 FROM openjdk:11-jre-slim
20 ARG PKG_FILENAME=nbi-rest-services-5.0.1-SNAPSHOT.jar
21 ADD target/$PKG_FILENAME app.jar
23 RUN addgroup appgroup && useradd -ms /bin/bash appuser && adduser appuser appgroup && mkdir temptoscafile && chown appuser:appgroup temptoscafile/
25 COPY src/main/resources/certificate /certs
26 ARG CERT_PASS=changeit
27 RUN for cert in $(ls -d /certs/*); do \
28 echo "adding $cert to java keystore..."; \
31 -storepass "${CERT_PASS}" \
32 -keystore $JAVA_HOME/lib/security/cacerts \
33 -alias "$(basename $cert)" \
39 ENV SERVER_PORT=${SERVER_PORT:-8080}
40 ENV JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom"
43 ENTRYPOINT java -XX:+UseContainerSupport $JAVA_OPTS -jar /app.jar