-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
61 lines (48 loc) · 1.29 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Set base docker
FROM python:3
# Authors
LABEL authors="31870999+KenwoodFox@users.noreply.github.com"
# Set the name of our app
ARG APP_NAME=email-blaster
ENV APP_NAME=${APP_NAME}
# Get the current git version
ARG GIT_COMMIT
ENV GIT_COMMIT=$GIT_COMMIT
# UID, GID
ARG USER_ID="1000"
ARG GROUP_ID="app"
# App home
ARG HOME="/app"
ENV HOME=${HOME}
# Perms for home
RUN groupadd --gid ${USER_ID} ${GROUP_ID} && \
useradd --create-home --uid ${USER_ID} --gid ${GROUP_ID} --home-dir /app ${GROUP_ID}
# Install packages
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
# Set workdir
WORKDIR ${HOME}
# Copy in all requirements
ADD requirements requirements/
# Install normal reqs
RUN pip install -r requirements/requirements.txt
# Install testing reqs
RUN pip install -r requirements/test_requirements.txt
# Copy in everything else
ADD . ${HOME}
# Add /bin to path
ENV PATH $PATH:${HOME}/bin
# Install our app in edit mode using pip
RUN pip install -e ${HOME}
# Drop root and change ownership of /app to app:app
RUN chown -R ${USER_ID}:${GROUP_ID} ${HOME}
USER ${USER_ID}
# Run the entrypoint bin
ENTRYPOINT ["entrypoint"]