forked from bjorns/mock-idp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (40 loc) · 1.1 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
FROM python:3.9.6-alpine3.14
RUN apk update && apk upgrade
# Dev dependencies for crypto package that can be
# remove after install
RUN apk add gcc musl-dev openssl-dev libffi-dev \
libxml2-dev libxslt-dev \
rust cargo
# Runtime dependencies
RUN apk add libxslt
RUN mkdir -p /usr/local/mock-idp
WORKDIR /usr/local/mock-idp
RUN pip install --upgrade pip
# cryptography is the most complicated package and if
# install fails in pipenv the error message is not
# clearly understandable. So we install it separately
RUN pip install cryptography
# Install environment
COPY Pipfile .
COPY Pipfile.lock .
RUN pip3 install pipenv
RUN pipenv install --system
# Copy code
COPY mockidp.yaml .
COPY bin ./bin
COPY mockidp ./mockidp
COPY doc ./doc
COPY tests ./tests
COPY setup.py .
COPY README.md .
# Install repo as package
RUN pip install -e .
# Remove build tools to save some space
RUN apk del gcc musl-dev openssl-dev libffi-dev \
libxml2-dev libxslt-dev \
rust cargo
# Clean out alpine apk package cache
RUN rm -rf /var/cache/apk/*
EXPOSE 5000
ENTRYPOINT [ "mock-idp", "--host", "0.0.0.0", "--port" ]
CMD [ "5000" ]