This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathDockerfile
48 lines (40 loc) · 1.58 KB
/
Dockerfile
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM php:7.0-fpm
MAINTAINER Superbalist <[email protected]>
RUN mkdir /opt/php-pubsub
WORKDIR /opt/php-pubsub
# Packages
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
zlib1g-dev \
unzip \
python \
&& ( \
cd /tmp \
&& mkdir librdkafka \
&& cd librdkafka \
&& git clone https://github.com/edenhill/librdkafka.git . \
&& ./configure \
&& make \
&& make install \
) \
&& rm -r /var/lib/apt/lists/*
# PHP Extensions
RUN docker-php-ext-install -j$(nproc) zip \
&& pecl install rdkafka \
&& docker-php-ext-enable rdkafka
# Composer
ENV COMPOSER_HOME /composer
ENV PATH /composer/vendor/bin:$PATH
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN curl -o /tmp/composer-setup.php https://getcomposer.org/installer \
&& curl -o /tmp/composer-setup.sig https://composer.github.io/installer.sig \
&& php -r "if (hash('SHA384', file_get_contents('/tmp/composer-setup.php')) !== trim(file_get_contents('/tmp/composer-setup.sig'))) { unlink('/tmp/composer-setup.php'); echo 'Invalid installer' . PHP_EOL; exit(1); }" \
&& php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer --version=1.1.0 && rm -rf /tmp/composer-setup.php
# Install Composer Application Dependencies
COPY composer.json /opt/php-pubsub/
RUN composer install --no-autoloader --no-scripts --no-interaction
COPY src /opt/php-pubsub/src
COPY examples /opt/php-pubsub/examples
RUN composer dump-autoload --no-interaction
CMD ["/bin/bash"]