⚙️ Docker image for Swoole apps with Composer, auto-restart on development and a production-ready version.
MIT License
⚠️ First, I'd like to invite you to take a look at the official Swoole image: https://hub.docker.com/r/phpswoole/swoole
Docker image for Swoole apps with Composer, auto-restart on development and a production-ready version.
composer.json
index.php
(this will be your entry-point)Entry-point file can be overridden with the environment variable ENTRY_POINT_FILE
. See this for an example.
A docker-compose.yml
file would look like:
version: "3"
services:
web:
container_name: my_app
image: leocavalcante/dwoole:dev
volumes:
- ./:/app
ports:
- "9501:9501"
Yeah! Simple like that.
Options enabled:
--enable-openssl
--enable-sockets
--enable-http2
--enable-mysqlnd
Comes bundled with:
Watch interval can be overridden with the environment variable WATCH_INTERVAL
.
Comes bundled with:
It is Swoole only. That is because only you knows what your project really needs. The recommended way to use the production variant is as a base image for you project image.
FROM leocavalcante/dwoole:prod
# Add only what your project really needs
COPY . /app
Then you can add whatever extensions you would like.
RUN apk add --no-cache freetype-dev libjpeg-turbo-dev libpng-dev libzip-dev \
&& docker-php-ext-configure gd && docker-php-ext-install -j$(nproc) gd zip
RUN pecl install mongodb \
&& docker-php-ext-enable mongodb
RUN pecl install redis \
&& docker-php-ext-enable redis
Linux containers only receive file change events (“inotify events”) if the original files are stored in the Linux filesystem. - https://docs.docker.com/docker-for-windows/wsl/
⚠ Dwoole will always commit to the latest PHP and Swoole versions.