use docker-compose to implement services
version: "3.6"
services:
redis:
image: redis
web:
image: cfanbo/swoole4_php7:v1
depends_on:
- redis
links:
- redis
volumes:
- /Users/sxf/sites/msgserve:/usr/src/myapp
command: "php src/push_server.php start"
Container environment: the web directory in the soole+php7
container is / usr/src/myapp,. Use volumes to mount the directory on the physical machine to the window. Php src/push_server.php start in the base is a service created by swoole framework and depends on the redis container. But when docker-compose up, it always prompts
msgserve_web_1 exited with code 0
Killing msgserve_redis_1 ... done
Container status
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8a60af07101b cfanbo/swoole4_php7:v1 "docker-php-entrypoi" Less than a second ago Exited (0) 13 seconds ago msgserve_web_1
20a803504037 redis "docker-entrypoint.s" 19 minutes ago Up 14 seconds 6379/tcp msgserve_redis_1
another redis container is normal. The log is "Server is already running.". How to solve the problem in this case?