记一次docker-compose启动php-cli+swoole,会退出的问题

记一次docker-compose启动php-cli+swoole,会退出的问题:

要加上tty:"true",开启虚拟终端。

爆栈原答案(https://stackoverflow.com/questions/37100358/docker-compose-exited-with-code-0):

The thing is that you are using the option -t when running your container.

Could you check if enabling the tty option (see reference) in your docker-compose.yml file the container keeps running?

version: '2'
services:
  ubuntu:
        build: .
        container_name: ubuntu
        volumes:
            - ~/sph/laravel52:/www/laravel
        ports:
          - "80:80"
        tty: true