blob: 9d77db6cc79fb59f8bd9ccf35ebc4026d5af7b52 [file] [log] [blame]
alex_sh9d980ce2017-08-23 17:30:56 -04001# Use an official Python runtime as a base image
2FROM python:2.7
3
4ENV INSROOT /opt/app
5ENV APPUSER policy_handler
6ENV APPDIR ${INSROOT}/${APPUSER}
7
8RUN useradd -d ${APPDIR} ${APPUSER}
9
10WORKDIR ${APPDIR}
11
12# Make port 25577 available to the world outside this container
13EXPOSE 25577
14
15# Copy the current directory contents into the container at ${APPDIR}
16COPY ./*.py ./
17COPY ./*.in ./
18COPY ./*.txt ./
19COPY ./*.sh ./
20COPY ./policyhandler/ ./policyhandler/
21COPY ./etc/ ./etc/
22
23RUN mkdir -p ${APPDIR}/logs \
alex_sh9d980ce2017-08-23 17:30:56 -040024 && chown -R ${APPUSER}:${APPUSER} ${APPDIR} \
25 && chmod a+w ${APPDIR}/logs \
alex_sh9d980ce2017-08-23 17:30:56 -040026 && chmod 500 ${APPDIR}/etc \
27 && chmod 500 ${APPDIR}/run_policy.sh \
28 && ls -la && ls -la ./policyhandler
29
30# Install any needed packages specified in requirements.txt
31RUN pip install -r requirements.txt
32
33USER ${APPUSER}
34
35VOLUME ${APPDIR}/logs
36
37# Run run_policy.sh when the container launches
38CMD ["./run_policy.sh"]