aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
blob: 9d77db6cc79fb59f8bd9ccf35ebc4026d5af7b52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# 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 \
 && chown -R ${APPUSER}:${APPUSER} ${APPDIR} \
 && chmod a+w ${APPDIR}/logs \
 && 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"]