aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorGokul Singaraju <gs244f@att.com>2018-05-21 15:32:52 -0400
committerGokul Singaraju <gs244f@att.com>2018-05-22 22:40:18 -0400
commit678e65fa7938114bf7d66f212b16cef8633db214 (patch)
treeb41462748c9101ea99ff3d3fa36296b159510a0c /Dockerfile
parent4571d99c799412d22e140ea8396ba9ad105626a8 (diff)
Miss HB CBS integration
Issue-ID: DCAEGEN2-279 Change-Id: I3f78e0870d4c620a304fb8d218f1d30187b4fbef Signed-off-by: Gokul Singaraju <gs244f@att.com>
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile49
1 files changed, 37 insertions, 12 deletions
diff --git a/Dockerfile b/Dockerfile
index cb4bc48..b489714 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,28 +1,53 @@
FROM python:3.6
MAINTAINER gs244f@att.com
-ADD . /tmp
+ENV INSROOT /opt/app
+ENV APPUSER misshtbt
+ENV APPDIR ${INSROOT}/${APPUSER}
+
+RUN useradd -d ${APPDIR} ${APPUSER}
+
+WORKDIR ${APPDIR}
+
+#ADD . /tmp
+#RUN mkdir /tmp/config
+
+EXPOSE 10001
+
+COPY ./miss_htbt_service/ ./bin/
+COPY ./etc/ ./etc/
+COPY requirements.txt ./
+COPY setup.py ./
#need pip > 8 to have internal pypi repo in requirements.txt
RUN pip install --upgrade pip
#do the install
-WORKDIR /tmp
+#WORKDIR /tmp
RUN pip install pyyaml --upgrade
RUN pip install -r requirements.txt
RUN pip install -e .
-RUN mkdir /tmp/config
-#RUN echo 1.2.3.4 > /tmp/config/coll_ip.txt
-#RUN echo 1234 > /tmp/config/coll_port.txt
-#RUN echo 4.5.6.7 > /tmp/config/pol_ip.txt
-#RUN echo 4567 > /tmp/config/pol_port.txt
-EXPOSE 10001
+RUN mkdir -p ${APPDIR}/data \
+ && mkdir -p ${APPDIR}/logs \
+ && mkdir -p ${APPDIR}/tmp \
+ && chown -R ${APPUSER}:${APPUSER} ${APPDIR} \
+ && chmod a+w ${APPDIR}/data \
+ && chmod a+w ${APPDIR}/logs \
+ && chmod a+w ${APPDIR}/tmp \
+ && chmod 500 ${APPDIR}/etc \
+ && chmod 500 ${APPDIR}/bin/*.py \
+ && chmod 500 ${APPDIR}/bin/*.sh \
+ && chmod 500 ${APPDIR}/bin/*/*.py
+
+USER ${APPUSER}
+VOLUME ${APPDIR}/logs
+
+CMD ["./bin/misshtbt.sh"]
#ENV PYTHONPATH="/usr/local/lib/python3.6:/usr/local/lib/python3.6/site-packages:${PATH}"
#ENV PYTHONPATH="/usr/local/lib/python3.6/site-packages:/usr/local/lib/python3.6"
-ENV PYTHONPATH=/usr/local/lib/python3.6/site-packages
-#CMD run.py
+#ENV PYTHONPATH=/usr/local/lib/python3.6/site-packages:.
#ENTRYPOINT ["/bin/python", "./bin/run.py"]
#ENTRYPOINT ["/usr/bin/python","./bin/run.py" ]
-ENTRYPOINT ["/usr/local/bin/python","./bin/run.py" ]
-#ENTRYPOINT ["/bin/ls","-lR", "/usr/local"]
+#ENTRYPOINT ["/usr/local/bin/python","./bin/misshtbtd.py" ]
+#ENTRYPOINT ["/bin/ls","-lR", "."]