Skip to content

Instantly share code, notes, and snippets.

@lahaxearnaud
Created November 10, 2018 11:04
Show Gist options
  • Save lahaxearnaud/8b34a41b146b82542fc831ffd7521e51 to your computer and use it in GitHub Desktop.
Save lahaxearnaud/8b34a41b146b82542fc831ffd7521e51 to your computer and use it in GitHub Desktop.
FROM php:7.2
# Composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
&& php composer-setup.php --install-dir=/bin --filename=composer \
&& php -r "unlink('composer-setup.php');"
# amqp
RUN apt-get update && apt-get install -y librabbitmq-dev libssh-dev \
&& docker-php-ext-install opcache bcmath sockets \
&& pecl install amqp \
&& docker-php-ext-enable amqp
# core tools
RUN apt-get install -y git-core
# php exts
RUN docker-php-ext-install pdo pdo_mysql zip mbstring
RUN mkdir /app
WORKDIR /app
env QUEUE_NAME amqp_default
ENTRYPOINT ["sh", "-c", "/app/bin/console messenger:consume-messages ${QUEUE_NAME} --limit=100 --time-limit=900 -n"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment