forked from codecov/codecov-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.requirements
56 lines (45 loc) · 1.68 KB
/
Dockerfile.requirements
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
# syntax=docker/dockerfile:1.3
# temp comment
# BUILD STAGE - Download dependencies from GitHub that require SSH access
FROM python:3.9.16-alpine3.17 as build
RUN apk update \
&& apk add --update --no-cache \
git \
openssh \
postgresql-dev \
musl-dev \
libxslt-dev \
python3-dev \
libffi-dev \
gcc \
libcurl \
bash \
rust \
build-base \
cargo \
curl-dev \
&& pip install --upgrade pip
RUN mkdir /root/.ssh/
RUN ssh-keyscan -H github.com >> /root/.ssh/known_hosts
COPY requirements.txt /
WORKDIR /pip-packages/
RUN --mount=type=ssh pip wheel -r /requirements.txt
# RUNTIME STAGE - Copy packages from build stage and install runtime dependencies
FROM python:3.9.16-alpine3.17
RUN apk -U upgrade binutils busybox expat libretls && \
apk add --no-cache postgresql-libs && \
apk add --no-cache --virtual .build-deps gcc \
musl-dev \
postgresql-dev \
libxslt-dev \
python3-dev \
build-base \
libffi-dev \
openssl-dev \
make \
curl-dev \
libcurl
WORKDIR /pip-packages/
COPY --from=build /pip-packages/ /pip-packages/
RUN rm -rf /pip-packages/src
RUN pip install --no-deps --no-index --find-links=/pip-packages/ /pip-packages/*