-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (21 loc) · 763 Bytes
/
Dockerfile
File metadata and controls
33 lines (21 loc) · 763 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
FROM python:3-slim AS buildtime
WORKDIR /app
RUN apt-get update
RUN apt-get --yes dist-upgrade
RUN apt-get --no-install-recommends --yes install gcc libc6-dev librdkafka-dev
RUN python -m venv venv
ENV PATH="./venv/bin:$PATH"
RUN --mount=type=cache,id=cache-pip,target=/root/.cache/pip pip install --upgrade pip
COPY requirements.txt .
RUN --mount=type=cache,id=cache-pip,target=/root/.cache/pip pip install -v -r requirements.txt
COPY *.py src/
COPY *.json src/
FROM python:3-slim AS runtime
WORKDIR /app
RUN apt-get update
RUN apt-get --yes dist-upgrade
RUN apt-get --no-install-recommends --yes install librdkafka1 procps curl
COPY --from=buildtime /app/venv venv
COPY --from=buildtime /app/src .
ENV PATH="./venv/bin:$PATH"
CMD tail -f /dev/null