aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authoralex_sh <alexs@att.com>2017-08-23 17:30:56 -0400
committeralex_sh <alexs@att.com>2017-08-23 17:59:20 -0400
commit9d980ce62d1f12d1e3fba48efb50398b8b95272a (patch)
treebbd0651db6ecb86bbdbae8594f00c5d37e0b30cf /Dockerfile
parent52b336b9a7c8b85460040bf56e4ad4d3e225ffd2 (diff)
policy-handler seed code
Change-Id: I35cd80b6e082f4b84740bab752774e8abc40ca35 Issue-Id: DCAEGEN2-46 Signed-off-by: Alex Shatov <alexs@att.com>
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile41
1 files changed, 41 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..10886f1
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,41 @@
+# Use an official Python runtime as a base image
+FROM python:2.7
+
+ENV INSROOT /opt/app
+ENV APPUSER policy_handler
+ENV APPDIR ${INSROOT}/${APPUSER}
+
+RUN useradd -d ${APPDIR} ${APPUSER}
+
+WORKDIR ${APPDIR}
+
+# Make port 25577 available to the world outside this container
+EXPOSE 25577
+
+# Copy the current directory contents into the container at ${APPDIR}
+COPY ./*.py ./
+COPY ./*.in ./
+COPY ./*.txt ./
+COPY ./*.sh ./
+COPY ./policyhandler/ ./policyhandler/
+COPY ./etc/ ./etc/
+
+RUN mkdir -p ${APPDIR}/logs \
+ && mkdir -p ${APPDIR}/tmp \
+ && mkdir -p ${APPDIR}/etc \
+ && chown -R ${APPUSER}:${APPUSER} ${APPDIR} \
+ && chmod a+w ${APPDIR}/logs \
+ && chmod 700 ${APPDIR}/tmp \
+ && chmod 500 ${APPDIR}/etc \
+ && chmod 500 ${APPDIR}/run_policy.sh \
+ && ls -la && ls -la ./policyhandler
+
+# Install any needed packages specified in requirements.txt
+RUN pip install -r requirements.txt
+
+USER ${APPUSER}
+
+VOLUME ${APPDIR}/logs
+
+# Run run_policy.sh when the container launches
+CMD ["./run_policy.sh"]