Created
June 24, 2022 06:07
-
-
Save pastuhov/920998777c9670eedf594a43c7d9c9f1 to your computer and use it in GitHub Desktop.
Dockerized python app with latest librdkafka lib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM gcc:bullseye AS builder | |
WORKDIR /root | |
RUN git clone https://github.com/edenhill/librdkafka.git | |
WORKDIR /root/librdkafka | |
RUN /root/librdkafka/configure --prefix=/root/librdkafka | |
RUN make | |
RUN make install | |
FROM python:3.10.5-bullseye | |
ENV PYTHONUNBUFFERED=1 | |
WORKDIR /app | |
COPY --from=builder /root/librdkafka /root/librdkafka | |
COPY requirements.txt requirements.txt | |
RUN \ | |
C_INCLUDE_PATH=/root/librdkafka/include \ | |
&& LIBRARY_PATH=/root/librdkafka/lib \ | |
&& pip3 install -r requirements.txt | |
COPY . . | |
CMD [ "python3", "main.py"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment