Skip to content

Commit

Permalink
feat: adding Coroutine server
Browse files Browse the repository at this point in the history
  • Loading branch information
byawitz committed Jul 3, 2024
1 parent bf24745 commit 6d5c75a
Show file tree
Hide file tree
Showing 6 changed files with 629 additions and 2 deletions.
48 changes: 48 additions & 0 deletions Dockerfile.swoole_coroutines
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM composer:2.0 AS step0

ARG TESTING=true
ARG DEBUG=false

ENV TESTING=$TESTING
ENV DEBUG=$DEBUG

WORKDIR /usr/local/src/

COPY composer.* /usr/local/src/

RUN composer install --ignore-platform-reqs --optimize-autoloader \
--no-plugins --no-scripts --prefer-dist \
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`

FROM appwrite/base:0.9.0 as final

ARG TESTING=true
ARG DEBUG=false

ENV TESTING=$TESTING
ENV DEBUG=$DEBUG

LABEL maintainer="[email protected]"

RUN \
if [ "$DEBUG" == "true" ]; then \
apk add boost boost-dev; \
fi

WORKDIR /usr/src/code

COPY ./dev /usr/src/code/dev
COPY ./src /usr/src/code/src
COPY ./tests /usr/src/code/tests
COPY ./phpunit.xml /usr/src/code/phpunit.xml
COPY ./phpbench.json /usr/src/code/phpbench.json
COPY --from=step0 /usr/local/src/vendor /usr/src/code/vendor

# Enable Extensions
RUN if [ "$DEBUG" == "true" ]; then cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini; fi
RUN if [ "$DEBUG" = "false" ]; then rm -rf /usr/src/code/dev; fi
RUN if [ "$DEBUG" = "false" ]; then rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so; fi

EXPOSE 80

CMD ["php", "tests/e2e/server-swoole-coroutine.php"]
17 changes: 15 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
build:
context: .
dockerfile: Dockerfile.swoole
ports:
ports:
- "9401:80"
volumes:
- ./dev:/usr/src/code/dev:rw
Expand All @@ -25,6 +25,19 @@ services:
- ./tmp/xdebug:/tmp/xdebug
networks:
- testing
swoole-coroutine:
build:
context: .
dockerfile: Dockerfile.swoole_coroutines
ports:
- "9402:80"
volumes:
- ./dev:/usr/src/code/dev:rw
- ./src:/usr/src/code/src
- ./tests:/usr/src/code/tests
- ./tmp/xdebug:/tmp/xdebug
networks:
- testing

mariadb:
image: mariadb:10.11 # fix issues when upgrading using: mysql_upgrade -u root -p
Expand All @@ -41,4 +54,4 @@ services:
command: "mysqld --innodb-flush-method=fsync --max-connections=10000"

networks:
testing:
testing:
Loading

0 comments on commit 6d5c75a

Please sign in to comment.