improve sdnc-web for external apps
[sdnc/oam.git] / installation / sdnc-web / src / main / docker / Dockerfile
1 ###
2 #============LICENSE_START=======================================================
3 # ONAP : ccsdk distribution web
4 #  ================================================================================
5 # Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
6 # All rights reserved.
7 # ================================================================================
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
11 #
12 #      http://www.apache.org/licenses/LICENSE-2.0
13 #
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
19 # ============LICENSE_END=========================================================
20 ###
21
22 # Base bitnami nginx image
23 FROM ${base.image.repo}
24 LABEL maintainer="CCSDK Team (onap-ccsdk@lists.onap.org)"
25 USER root
26 RUN apt-get update && apt-get install python3-minimal python3-urllib3 unzip openssl -y
27 USER 1001
28 # copy ODLUX files to nginx
29 COPY html /opt/bitnami/nginx/html  
30
31 # copy site conf files 
32 COPY conf/* /opt/bitnami/nginx/conf/server_blocks/
33
34 # setup environment variables
35 ENV WEBPROTOCOL="HTTP" \
36     WEBPORT="8080" \
37     SDNRPROTOCOL="HTTP" \
38     SDNRHOST="172.18.0.3" \
39     SDNRPORT="8181" \
40     TRPCEURL="" \
41     TOPOURL="" \
42     TILEURL="" \
43     SITEDOCURL="" \
44     DNS_RESOLVER="1.1.1.1 ipv6=off" \
45     DNS_INTERNAL_RESOLVER="127.0.0.11" \
46     SSL_CERT_DIR="/app/cert" \
47     SSL_CERTIFICATE="cert.pem" \
48     SSL_CERTIFICATE_KEY="cert.key"
49
50 # Check if /app can be used. If so, create "custom" directory and copy the files there.
51 COPY bin/* /opt/bitnami/nginx/sbin/ 
52
53 USER root
54 RUN chmod +x /opt/bitnami/nginx/sbin/run.sh /opt/bitnami/nginx/sbin/opm.py
55 # By default, docker copies files with the permissions of the build user. To avoid cases where build user 
56 # has 644 which can result in failure of certain commands
57 RUN chmod -R g+w /opt/bitnami/nginx/html/odlux && mkdir /app/init.d
58 RUN chmod 666 /opt/bitnami/nginx/conf/server_blocks/*.rules
59 #RUN chown 1001:1001 /app/odlux.application.list && chmod 777 /app/odlux.application.list
60 RUN chown -R 1001:1001 /app
61 RUN ln -s /opt/bitnami/nginx/sbin/opm.py /usr/local/bin/opm
62 USER 1001
63 CMD [ "/opt/bitnami/nginx/sbin/run.sh" ]
64