This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockerfile
45 lines (36 loc) · 1.5 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
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 \
&& rm -r /var/lib/apt/lists/*
# PHP Extensions
RUN docker-php-ext-install -j$(nproc) zip \
&& pecl install grpc \
&& docker-php-ext-enable grpc
RUN pecl install protobuf \
&& docker-php-ext-enable protobuf
# 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 your-gcloud-key.json /opt/php-pubsub
COPY examples /opt/php-pubsub/examples
COPY phpunit.php /opt/php-pubsub
COPY phpunit.xml /opt/php-pubsub
COPY tests /opt/php-pubsub/tests
RUN composer dump-autoload --no-interaction
CMD ["/bin/bash"]