Rails server is still running in a new opened docker container

前端 未结 9 1506
面向向阳花
面向向阳花 2021-01-31 08:05

I want to deploy my rails project using Docker. So I use Docker-Compose. But I get one weird error message. When run docker-compose up(this contains db-container with postgresql

9条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-31 08:23

    For ones, who have problem when there is no tmp/pids/server.pid actually exists:

    (Docker version 1.11.2, build b9f10c9)

    1. Solution, which worked for me is to add exact command to docker-compose.yml, for example:

      command:
         rails s -b0
      

      Having this command, which in fact may simply duplicate Dockerfile's CMD - issue with stale .pid do not appear.

    2. Other option, when you need to use Dockerfile's CMD, is to run with option --build to rebuild image:

      docker-compose up --build
      

      Though it takes time, so first solution is more convenient

提交回复
热议问题