Skip to content

Commit c69323b

Browse files
committed
feat: swoole
1 parent bec0bdb commit c69323b

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

Dockerfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Container Base
2-
FROM php:8.3-apache
2+
FROM php:8.3
33

44
ENV \
55
NR_ENABLED=false \
@@ -28,8 +28,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends wget vim superv
2828
sudo zlib1g zlib1g-dev libzip4 libzip-dev zip unzip librabbitmq-dev musl-dev && \
2929
rm -rf /var/lib/apt/lists/*
3030

31-
RUN a2enmod rewrite unique_id headers
32-
3331
RUN docker-php-ext-configure gd --with-jpeg \
3432
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
3533
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
@@ -59,6 +57,10 @@ RUN echo "---> Configure Opcache" && \
5957
echo "opcache.enable=0" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini && \
6058
echo "opcache.enable_cli=0" >> /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini
6159

60+
RUN echo "---> Swoole" && \
61+
pecl install swoole -D 'enable-http2="yes"' && \
62+
docker-php-ext-enable swoole
63+
6264
RUN echo "---> Adding NewRelic" && \
6365
apt-get update && apt-get install -y -q --no-install-recommends --no-install-suggests gnupg2 \
6466
&& echo 'deb http://apt.newrelic.com/debian/ newrelic non-free' | sudo tee /etc/apt/sources.list.d/newrelic.list \
@@ -80,18 +82,15 @@ RUN echo "---> Config sudoers" && \
8082

8183
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
8284
RUN echo "---> Fix permissions" \
83-
&& chown -R www-data:www-data /var/log/apache2 \
8485
&& mkdir /var/www/.composer && chown -R www-data:www-data /var/www/.composer
8586

86-
COPY configs/ports.conf /etc/apache2/ports.conf
87-
COPY configs/headers.conf /etc/apache2/conf-enabled/headers.conf
8887
COPY configs/logs.conf /etc/apache2/conf-enabled/logs.conf
8988
COPY configs/php-errors.ini /usr/local/etc/php/conf.d/php-errors.ini
90-
COPY apache-run.sh /usr/bin/apache-run
89+
COPY swoole-run.sh /usr/bin/swoole-run
9190
COPY ./bin /usr/bin/
9291

9392
RUN chmod a+x \
94-
/usr/bin/apache-run \
93+
/usr/bin/swoole-run \
9594
/usr/bin/xdebug-set-mode \
9695
/usr/bin/post-startup-hook
9796

@@ -101,4 +100,4 @@ WORKDIR "/var/www/html"
101100

102101
EXPOSE 8080 9001
103102

104-
CMD ["/tini", "--", "/usr/bin/apache-run"]
103+
CMD ["/tini", "--", "/usr/bin/swoole-run"]

apache-run.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

swoole-run.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
server-warmup
6+
7+
exec /usr/local/bin/php ./server.php

0 commit comments

Comments
 (0)