forked from mozilla/probe-scraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (32 loc) · 1.01 KB
/
Dockerfile
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
39
40
41
42
43
FROM python:3
MAINTAINER Harold Woo <[email protected]>
ENV PYTHONUNBUFFERED=1
ARG APP_NAME=probe-scraper
ENV APP_NAME=${APP_NAME}
# Guidelines here: https://github.com/mozilla-services/Dockerflow/blob/master/docs/building-container.md
ARG USER_ID="10001"
ARG GROUP_ID="app"
ARG HOME="/app"
ENV HOME=${HOME}
RUN groupadd --gid ${USER_ID} ${GROUP_ID} && \
useradd --create-home --uid ${USER_ID} --gid ${GROUP_ID} --home-dir /app ${GROUP_ID}
# List packages here
RUN apt-get update && \
apt-get install -y --no-install-recommends \
file \
gcc \
libwww-perl && \
apt-get autoremove -y && \
apt-get clean
# Upgrade pip
RUN pip install --upgrade pip
WORKDIR ${HOME}
COPY requirements.txt ${HOME}/
RUN pip install -r requirements.txt
COPY test_requirements.txt ${HOME}/
RUN pip install -r test_requirements.txt
COPY . ${HOME}
RUN pip install .
# Drop root and change ownership of the application folder to the user
RUN chown -R ${USER_ID}:${GROUP_ID} ${HOME}
USER ${USER_ID}