Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
53 lines (53 loc) · 1.86 KB
/
Copy pathdocker-compose.yml
File metadata and controls
53 lines (53 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
services:
server:
image: deminy/swoole-by-examples:server-6.2
environment:
# ROOT_DIR limits what the autoreload script watches; without it, any PHP file changed under /var/www
# (e.g., Composer writing into ./vendor) would restart all the Supervisord-managed servers.
ROOT_DIR: /var/www/examples
AUTORELOAD_PROGRAMS: "http1 http1-integrated http2 rock-paper-scissors tcp-event-driven tcp-coroutine-style udp websocket"
DISABLE_DEFAULT_SERVER: 1
ports:
- 9801:9801
volumes:
- .:/var/www
client:
image: deminy/swoole-by-examples:client-6.2
environment:
DISABLE_DEFAULT_SERVER: 1
links:
- mysql
- postgresql
- redis
- server
volumes:
- .:/var/www
# A thread-safe (ZTS) build of PHP, which the examples under examples/threads/ (and locks/lock-across-threads.php)
# need; the server and client images are non-ZTS. The official image is used as-is, with the same layout as the
# other two containers.
zts:
image: phpswoole/swoole:6.2-php8.4-zts
environment:
DISABLE_DEFAULT_SERVER: 1
working_dir: /var/www/examples
volumes:
- .:/var/www
redis:
image: redis:8-alpine
mysql:
image: mysql:8
environment:
MYSQL_DATABASE: test
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: username
postgresql:
image: postgres:17-alpine
# The default limit of 100 connections is exactly the size of the connection pool in
# examples/pool/database-pool/pdo_pgsql.php, so other PostgreSQL examples running at the same time (e.g., in the
# test suite) could be refused with "too many clients already". Raise the limit to leave room for them.
command: ["postgres", "-c", "max_connections=200"]
environment:
POSTGRES_DB: test
POSTGRES_USER: username
POSTGRES_PASSWORD: password