Skip to content

Commit f2c85d1

Browse files
committed
feat: start swoole
1 parent 30992c6 commit f2c85d1

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
FROM lojassimonetti/php-apache-oci8-composer:php8dot3
22

3+
COPY ./bin /usr/bin/
4+
35
USER root
46

57
RUN echo "---> Swoole" && \
68
pecl install swoole && \
9+
docker-php-ext-configure swoole --enable-http2 && \
710
docker-php-ext-enable swoole
811

912
USER www-data:www-data
13+
14+
CMD ["/tini", "--", "/usr/bin/swoole-run"]

bin/pre-run-hook

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
rm -f $CONTAINER_STARTED_LOCK
4+
5+
if [[ ${XDEBUG_ENABLED} == true ]]; then
6+
sudo -E xdebug-set-mode ${XDEBUG_MODE:-debug}
7+
fi
8+
9+
sudo -E newrelic-setup
10+
sudo -E opcache-setup
11+
12+
if [[ ${SESSION_HANDLER} == true ]]; then
13+
sudo rm -f /usr/local/etc/php/conf.d/session-handler.ini
14+
echo "session.save_handler = ${SESSION_HANDLER_NAME}" | sudo tee -a /usr/local/etc/php/conf.d/session-handler.ini
15+
echo "session.save_path = \"${SESSION_HANDLER_PATH}\"" | sudo tee -a /usr/local/etc/php/conf.d/session-handler.ini
16+
fi
17+
18+
sudo rm -rf var/cache/* var/logs/* &&
19+
sudo mkdir -p /var/www/html/var/cache &&
20+
sudo mkdir -p /var/www/html/var/logs &&
21+
sudo mkdir -p /var/www/html/var/sessions &&
22+
sudo chown -R www-data:www-data /var/www/html/var/cache && chmod 777 /var/www/html/var/cache &&
23+
sudo chown -R www-data:www-data /var/www/html/var/logs && chmod 777 /var/www/html/var/logs &&
24+
sudo chown -R www-data:www-data /var/www/html/var/sessions && chmod 777 /var/www/html/var/sessions
25+
26+
post-startup-hook
27+
28+
touch $CONTAINER_STARTED_LOCK

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+
pre-run
6+
7+
exec /usr/local/bin/php /var/www/html/server.php

0 commit comments

Comments
 (0)