Add deamon mode to dockerfile
[cli.git] / deployment / docker / src / main / docker / Dockerfile
1 FROM ubuntu:14.04
2
3 RUN apt-get update
4 RUN apt-get update && apt-get install -y software-properties-common
5 RUN sudo -E add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk && apt-get install -y lighttpd
6 ENV JAVA_HOME usr/lib/jvm/java-8-openjdk-amd64
7
8 ENV ONAP_CLI_HOME /opt/onap/cli
9 ADD ./STAGE $ONAP_CLI_HOME
10 COPY ./STAGE/http/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf
11 COPY ./STAGE/http/web /var/www-data/servers/onap-cli/
12 COPY ./STAGE/installer/*.zip /var/www-data/servers/onap-cli/
13
14 WORKDIR $ONAP_CLI_HOME
15 RUN chmod +x ./bin/onap.sh
16 RUN if [ ! -d ./data ]; then mkdir ./data; fi
17 RUN if [ ! -d ./onap-cli-schema ]; then mkdir ./onap-cli-schema; fi
18 RUN if [ ! -f /var/log/lighttpd/access.log ]; then touch /var/log/lighttpd/access.log; fi
19 RUN ln ./bin/onap.sh /usr/sbin/onap
20
21 EXPOSE 80
22
23 ENV ONAP_HOST_URL http://localhost:8080
24 ENV ONAP_USERNAME guest
25 ENV ONAP_PASSWORD guest
26 ENV ONAP_CLI_DEBUG false
27 ENV ONAP_CLI_DEBUG_PORT 5005
28 ENV MODE console
29
30 ENTRYPOINT cp /etc/lighttpd/conf-available/10-accesslog.conf /etc/lighttpd/conf-enabled/ && \
31            service lighttpd start && \
32            if [ "$MODE" = "deamon" ]; then tailf /var/log/lighttpd/access.log;else /bin/bash; fi
33
34 RUN echo ONAP CLI docker successfully created !!