Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local server.pid file prevents docker container from starting back up #13

Closed
angelocordon opened this issue Nov 11, 2018 · 4 comments
Closed
Assignees
Labels
devops Devops related problems
Milestone

Comments

@angelocordon
Copy link
Contributor

In some instances, when starting the container back up after stopping, a log error pops up:

web_1  | A server is already running. Check /dungeonbuddies/tmp/pids/server.pid.

Running docker-compose ps to list container status returns:

     Name                      Command               State     Ports  
-------------------------------------------------------------------------
dungeonbuddies_db_1    docker-entrypoint.sh postgres    Up       5432/tcp
dungeonbuddies_web_1   bundle exec rails s -p 300 ...   Exit 1            

A quick and dirty solution is to remove the server.pid file in the above directory:

rm ./tmp/pids/server.pid

Also see: https://stackoverflow.com/questions/35022428/rails-server-is-still-running-in-a-new-opened-docker-container

However, logging this as an issue to keep track of how frequent this is happening and that we should look for ways around it so that restarting a container back up is more predictable.

@angelocordon angelocordon added the devops Devops related problems label Nov 11, 2018
@stain88
Copy link
Collaborator

stain88 commented Nov 11, 2018

docker/compose#1393

Some more discussion and workarounds.

@angelocordon
Copy link
Contributor Author

Yeah, I like this comment here: docker/compose#1393 (comment)

angelocordon added a commit that referenced this issue Nov 11, 2018
See #13

Co-Authored-By: angelocordon <angelocordon@gmail.com>
angelocordon added a commit that referenced this issue Nov 11, 2018
See #13

Co-Authored-By: angelocordon <angelocordon@gmail.com>
@angelocordon angelocordon self-assigned this Nov 23, 2018
@angelocordon angelocordon added this to the Release 0.0.1 milestone Nov 23, 2018
@angelocordon
Copy link
Contributor Author

#24 fixes this issue with

- type: tmpfs
target: /dungeonbuddies/tmp/pids/

From https://auth0.com/blog/ruby-on-rails-killer-workflow-with-docker-part-1/

The second volume masks the tmp folder in the host OS so that all other project folders are available for the container except the tmp. When you run docker-compose down, this tmp folder within the container is wiped out.

@angelocordon
Copy link
Contributor Author

Marking as closed in favor of #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops Devops related problems
Projects
None yet
Development

No branches or pull requests

2 participants