From 678e65fa7938114bf7d66f212b16cef8633db214 Mon Sep 17 00:00:00 2001 From: Gokul Singaraju Date: Mon, 21 May 2018 15:32:52 -0400 Subject: Miss HB CBS integration Issue-ID: DCAEGEN2-279 Change-Id: I3f78e0870d4c620a304fb8d218f1d30187b4fbef Signed-off-by: Gokul Singaraju --- Dockerfile | 49 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 12 deletions(-) (limited to 'Dockerfile') 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", "."] -- cgit 1.2.3-korg