-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (30 loc) · 831 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (30 loc) · 831 Bytes
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
FROM docker.io/library/python:3.9-alpine
COPY requirements.txt /app/requirements.txt
ENV PATH="/app/.venv/bin:${PATH}"
RUN apk add --update --virtual .build-deps \
postgresql-dev \
gcc \
rust \
cargo \
libffi-dev \
musl-dev \
openssl-dev \
&& python3 -m venv /app/.venv \
&& pip3 install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt \
&& runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)" \
&& apk add --update --virtual .controller-rundeps \
$runDeps \
ca-certificates \
su-exec \
bash \
shadow \
&& apk del .build-deps
COPY . /app
WORKDIR /app
CMD ["/app/bin/boot"]
EXPOSE 8000