-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (28 loc) · 794 Bytes
/
Dockerfile
File metadata and controls
34 lines (28 loc) · 794 Bytes
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
# Mozilla PollBot server
FROM python:3.8-slim
RUN groupadd -g 10001 pollbot && \
useradd -M -u 10001 -g 10001 -G pollbot -d /app -s /sbin/nologin pollbot
WORKDIR /app
COPY . /app
ENV PORT 9876
ENV PYTHONBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONPATH /app
RUN buildDeps=' \
gcc \
libxml2-dev \
' && \
# install deps
apt-get update -y && \
apt-get install -y --no-install-recommends $buildDeps && \
pip install -r requirements.txt && \
pip install -e /app && \
# cleanup
apt-get purge -y $buildDeps && \
rm -rf /var/lib/apt/lists/* && \
# allow run-tests.sh to run pip install successfully
chown pollbot:pollbot /app && \
chown -R pollbot:pollbot /app/pollbot.egg-info
USER pollbot
# Start the pollbot server
CMD pollbot