Rails server is still running in a new opened docker container

前端 未结 9 1430
面向向阳花
面向向阳花 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:21

    You are using an onbuild image, so your working direcotry is mounted in the container image. This is very good for developing, since your app is updated in realtime when you edit your code, and your host system gets updated for example when you run a migration.

    This also means that your host system tmp directory will be written with the pid file every time a server is running and will remain there if the server is not shut down correctly.

    Just run this command from your host system:

    sudo rm tmp/pids/server.pid 
    

    This can be a real pain when you are for example using foreman under docker-compose, since just pressing ctrl+c will not remove the pid file.

提交回复
热议问题