Skip to content

Commit 6d5c75a

Browse files
committed
feat: adding Coroutine server
1 parent bf24745 commit 6d5c75a

File tree

6 files changed

+629
-2
lines changed

6 files changed

+629
-2
lines changed

Dockerfile.swoole_coroutines

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM composer:2.0 AS step0
2+
3+
ARG TESTING=true
4+
ARG DEBUG=false
5+
6+
ENV TESTING=$TESTING
7+
ENV DEBUG=$DEBUG
8+
9+
WORKDIR /usr/local/src/
10+
11+
COPY composer.* /usr/local/src/
12+
13+
RUN composer install --ignore-platform-reqs --optimize-autoloader \
14+
--no-plugins --no-scripts --prefer-dist \
15+
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
16+
17+
FROM appwrite/base:0.9.0 as final
18+
19+
ARG TESTING=true
20+
ARG DEBUG=false
21+
22+
ENV TESTING=$TESTING
23+
ENV DEBUG=$DEBUG
24+
25+
LABEL maintainer="[email protected]"
26+
27+
RUN \
28+
if [ "$DEBUG" == "true" ]; then \
29+
apk add boost boost-dev; \
30+
fi
31+
32+
WORKDIR /usr/src/code
33+
34+
COPY ./dev /usr/src/code/dev
35+
COPY ./src /usr/src/code/src
36+
COPY ./tests /usr/src/code/tests
37+
COPY ./phpunit.xml /usr/src/code/phpunit.xml
38+
COPY ./phpbench.json /usr/src/code/phpbench.json
39+
COPY --from=step0 /usr/local/src/vendor /usr/src/code/vendor
40+
41+
# Enable Extensions
42+
RUN if [ "$DEBUG" == "true" ]; then cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini; fi
43+
RUN if [ "$DEBUG" = "false" ]; then rm -rf /usr/src/code/dev; fi
44+
RUN if [ "$DEBUG" = "false" ]; then rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so; fi
45+
46+
EXPOSE 80
47+
48+
CMD ["php", "tests/e2e/server-swoole-coroutine.php"]

docker-compose.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ services:
1616
build:
1717
context: .
1818
dockerfile: Dockerfile.swoole
19-
ports:
19+
ports:
2020
- "9401:80"
2121
volumes:
2222
- ./dev:/usr/src/code/dev:rw
@@ -25,6 +25,19 @@ services:
2525
- ./tmp/xdebug:/tmp/xdebug
2626
networks:
2727
- testing
28+
swoole-coroutine:
29+
build:
30+
context: .
31+
dockerfile: Dockerfile.swoole_coroutines
32+
ports:
33+
- "9402:80"
34+
volumes:
35+
- ./dev:/usr/src/code/dev:rw
36+
- ./src:/usr/src/code/src
37+
- ./tests:/usr/src/code/tests
38+
- ./tmp/xdebug:/tmp/xdebug
39+
networks:
40+
- testing
2841

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

4356
networks:
44-
testing:
57+
testing:

0 commit comments

Comments
 (0)