Chore: Add gerrit maven verify GHA workflow
[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     SDNRWEBSOCKETPORT="8182" \
41     TRPCEURL="" \
42     TOPOURL="" \
43     TILEURL="" \
44     SITEDOCURL="" \
45     DNS_RESOLVER="1.1.1.1 ipv6=off" \
46     DNS_INTERNAL_RESOLVER="127.0.0.11" \
47     SSL_CERT_DIR="/app/cert" \
48     SSL_CERTIFICATE="cert.pem" \
49     SSL_CERTIFICATE_KEY="cert.key"
50
51 # Check if /app can be used. If so, create "custom" directory and copy the files there.
52 COPY bin/* /opt/bitnami/nginx/sbin/ 
53
54 USER root
55 RUN chmod +x /opt/bitnami/nginx/sbin/run.sh /opt/bitnami/nginx/sbin/opm.py
56 # By default, docker copies files with the permissions of the build user. To avoid cases where build user 
57 # has 644 which can result in failure of certain commands
58 RUN chmod -R g+w /opt/bitnami/nginx/html/odlux && mkdir /app/init.d
59 RUN chmod 666 /opt/bitnami/nginx/conf/server_blocks/*.rules
60 #RUN chown 1001:1001 /app/odlux.application.list && chmod 777 /app/odlux.application.list
61 RUN chown -R 1001:1001 /app
62 RUN ln -s /opt/bitnami/nginx/sbin/opm.py /usr/local/bin/opm
63 USER 1001
64 CMD [ "/opt/bitnami/nginx/sbin/run.sh" ]
65