diff --git a/README.md b/README.md index d0aed6bb..1536d7f8 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,6 @@ A working script is available in the bundled `examples` directory - Start Server : `php examples/server.php` Start Client(s) : `php examples/client.php` -Messaging part require to install [Docker](https://www.docker.com) and execute `docker-compose up -d` - ## Documentation [https://darkwood-fr.github.io/flow](https://darkwood-fr.github.io/flow) diff --git a/tools/dev/Dockerfile b/tools/dev/Dockerfile new file mode 100644 index 00000000..e306f5f1 --- /dev/null +++ b/tools/dev/Dockerfile @@ -0,0 +1,22 @@ +# syntax=docker/dockerfile:1.6.0 + +FROM php:8.2-fpm-alpine as php + +RUN apk add --update make curl + +COPY --from=composer:2.6.2 /usr/bin/composer /usr/bin/composer +COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ +RUN curl "https://github.com/jolicode/castor/releases/latest/download/castor.linux-amd64.phar" -Lso /usr/local/bin/castor && chmod u+x /usr/local/bin/castor + +RUN set -eux; \ + install-php-extensions \ + apcu \ + intl \ + opcache \ + zip \ + openswoole \ + ; + +WORKDIR /flow + +CMD ["php-fpm"] diff --git a/tools/dev/docker-compose.yml b/tools/dev/docker-compose.yml index a7d4796e..3aad6efd 100644 --- a/tools/dev/docker-compose.yml +++ b/tools/dev/docker-compose.yml @@ -1,11 +1,16 @@ version: '3' services: - mysql: - image: mysql:8.1 - environment: - - MYSQL_ROOT_PASSWORD=root - - MYSQL_DATABASE=flow - - MYSQL_USER=flow - - MYSQL_PASSWORD=flow - ports: - - 3306:3306 \ No newline at end of file + php: + image: flow-php + build: + context: . + target: php + volumes: + - ../..:/flow + mysql: + image: mysql:8.1 + environment: + - MYSQL_ROOT_PASSWORD=root + - MYSQL_DATABASE=flow + - MYSQL_USER=flow + - MYSQL_PASSWORD=flow