forked from GitGuardian/ggshield
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
56 lines (39 loc) · 1.24 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
FROM python:3.8-buster as build
LABEL maintainer="GitGuardian SRE Team <[email protected]>"
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV PIPENV_VENV_IN_PROJECT true
WORKDIR /app
# Install your required build dependencies here
RUN set -e ; \
apt-get update ; \
apt-get dist-upgrade -y --no-install-recommends ; \
apt-get autoremove -y ; \
apt-get clean ; \
pip3 install pipenv --upgrade ; \
rm -rf /var/lib/apt/lists/*
# COPY Pipfile Pipfile.lock ./
# OR (choose depending on whether you need the ./setup.py to get executed or not)
COPY . ./
RUN sed -i '/editable/d' Pipfile.lock
RUN pipenv install --ignore-pipfile
FROM python:3.8-slim-buster
LABEL maintainer="GitGuardian SRE Team <[email protected]>"
RUN set -e ; \
apt-get update ; \
apt-get dist-upgrade -y --no-install-recommends ; \
apt-get install -y --no-install-recommends git ; \
apt-get autoremove -y ; \
apt-get clean ; \
rm -rf /var/lib/apt/lists/*
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV PATH /app/.venv/bin:$PATH
WORKDIR /app
RUN set -ex; \
groupadd -g 1337 app; \
useradd -u 1337 -g 1337 -b /home -c "GitGuardian App User" -m -s /bin/sh app;
COPY --from=build /app/.venv /app/.venv
COPY ./ ./
USER app
CMD ["ggshield"]