alexandreo / dwoole

⚙️ Docker image for Swoole apps with Composer, auto-restart on development and a production-ready version.

Home Page:https://cloud.docker.com/repository/docker/leocavalcante/dwoole

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dwoole

Docker image for Swoole apps with Composer, auto-restart on development and a production-ready version.

Usage

Requirements

  • 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.

Exposed port is 9501

Using Docker Compose?

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.

What is inside?

Options enabled:

  • --enable-openssl
  • --enable-sockets
  • --enable-http2
  • --enable-mysqlnd

Development

Comes bundled with:

  • Hot-restart
  • PDO MySQL & MySQLi
  • MongoDB
  • Redis

Production

Comes bundled with:

  • Nothing

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.

Adding PHP extensions
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
  docker-php-ext-install -j$(nproc) \
  exif \
  gd \
  mysqli \
  pdo_mysql
Adding PECL extensions
RUN pecl install mongodb \
  && docker-php-ext-enable mongodb
RUN pecl install redis \
  && docker-php-ext-enable redis

Why not inotify?

docker/for-win#56

⚠ Dwoole will always commit to the latest PHP and Swoole versions

About

⚙️ Docker image for Swoole apps with Composer, auto-restart on development and a production-ready version.

https://cloud.docker.com/repository/docker/leocavalcante/dwoole

License:MIT License


Languages

Language:PHP 56.6%Language:Dockerfile 31.6%Language:Shell 7.2%Language:PowerShell 4.6%