Skip to content

Instantly share code, notes, and snippets.

@pastuhov
Created June 24, 2022 06:07
Show Gist options
  • Save pastuhov/920998777c9670eedf594a43c7d9c9f1 to your computer and use it in GitHub Desktop.
Save pastuhov/920998777c9670eedf594a43c7d9c9f1 to your computer and use it in GitHub Desktop.
Dockerized python app with latest librdkafka lib
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