-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
84 lines (69 loc) · 1.93 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
FROM alpine:3.18 AS stage1
LABEL maintainer="TeskaLabs Ltd ([email protected])"
ENV LANG=C.UTF-8
RUN set -ex \
&& apk update \
&& apk upgrade
RUN apk add --no-cache \
python3 \
py3-pip \
libstdc++ \
openssl \
openldap
# Create build environment so that dependencies like aiohttp can be build
# Run all as a single command in order to reduce image size --virtual buildenv
RUN apk add --no-cache \
git \
python3-dev \
libffi-dev \
openssl-dev \
gcc \
g++ \
musl-dev \
openldap-dev \
rust \
cargo \
&& pip3 install --upgrade pip \
&& pip3 install --no-cache-dir \
aiohttp \
aiosmtplib \
motor \
cryptography \
jwcrypto>=0.9.1 \
fastjsonschema \
bcrypt \
argon2_cffi \
python-ldap \
aiomysql \
jinja2 \
pyotp \
webauthn==1.9.0 \
pyyaml \
pymongo \
sentry-sdk \
git+https://github.com/TeskaLabs/asab.git
# There is a broken pydantic dependency in webauthn.
# Remove the version lock once this is fixed.
RUN cat /usr/lib/python3.11/site-packages/asab/__version__.py
RUN mkdir -p /app/seacat-auth
WORKDIR /app/seacat-auth
# Create MANIFEST.json in the working directory
# The manifest script requires git to be installed
COPY ./.git /app/seacat-auth/.git
RUN asab-manifest.py ./MANIFEST.json
FROM alpine:3.18
RUN apk add --no-cache \
python3 \
openssl \
openldap
COPY --from=stage1 /usr/lib/python3.11/site-packages /usr/lib/python3.11/site-packages
COPY ./seacatauth /app/seacat-auth/seacatauth
COPY ./seacatauth.py /app/seacat-auth/seacatauth.py
COPY ./CHANGELOG.md /app/seacat-auth/CHANGELOG.md
COPY --from=stage1 /app/seacat-auth/MANIFEST.json /app/seacat-auth/MANIFEST.json
COPY ./etc/message_templates /app/seacat-auth/etc/message_templates
RUN set -ex \
&& mkdir /conf \
&& touch /conf/seacatauth.conf
WORKDIR /app/seacat-auth
CMD ["python3", "seacatauth.py", "-c", "/conf/seacatauth.conf"]