-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
43 lines (33 loc) · 1.06 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
# DOCKER-VERSION 1.3.2
FROM composer:latest as composer
FROM php:7.4-cli
WORKDIR /var/www
ARG SWOOLEVERSION
ENV SWOOLEPACKAGE swoole-$SWOOLEVERSION.tgz
# System dependencies
RUN apt-get update && \
apt-get install -y git libbz2-dev libicu-dev libnghttp2-dev libtidy-dev libxslt1-dev procps zlib1g-dev && \
rm -rf /var/lib/apt/lists/* && \
docker-php-ext-install -j$(nproc) sockets
# Compile and install Swoole
RUN mkdir -p /tmp/swoole && \
cd /tmp/swoole && \
curl -s -o swoole.tgz https://pecl.php.net/get/$SWOOLEPACKAGE && \
tar xzvf swoole.tgz --strip-components=1 && \
phpize && \
./configure --enable-http2 && \
make && \
make install && \
cd /tmp && \
rm -Rf swoole
# PHP configuration
COPY swoole.ini $PHP_INI_DIR/conf.d/000-swoole.ini
# Install composer
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
# Install Prestissimo composer plugin
RUN composer global require hirak/prestissimo
# Project files
COPY index.php /var/www/public/
COPY entrypoint /usr/local/bin/
EXPOSE 9000
ENTRYPOINT ["entrypoint"]