Skip to content

Instantly share code, notes, and snippets.

@mateusjunges
Created February 14, 2024 15:24
Show Gist options
  • Save mateusjunges/6525b1dd70df8d061ef6282b9c07d1a6 to your computer and use it in GitHub Desktop.
Save mateusjunges/6525b1dd70df8d061ef6282b9c07d1a6 to your computer and use it in GitHub Desktop.
Dockerfile for laravel kafka
ARG PHP_VERSION
FROM php:${PHP_VERSION}-fpm-alpine
ARG LIBRDKAFKA_VERSION
ARG EXT_RDKAFKA_VERSION
ARG LARAVEL_VERSION
RUN apk update && \
apk add git zlib-dev libressl-dev libsasl zstd-dev build-base && \
git config --global advice.detachedHead false && \
apk add bash
RUN git clone --branch ${LIBRDKAFKA_VERSION} https://github.com/edenhill/librdkafka.git && \
cd librdkafka && \
./configure --install-deps && \
make && \
make install
RUN apk update && \
apk add autoconf && \
pecl install rdkafka-${EXT_RDKAFKA_VERSION}
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
RUN composer global require laravel/installer
WORKDIR /application
RUN cd /application && \
composer create-project --prefer-dist laravel/laravel laravel-test "${LARAVEL_VERSION}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment