Rails server will not start in container because server is already running

Viewed 909

Basically same problem as here: Server is already running in Rails

A server is already running. Check /app/tmp/pids/server.pid.
=> Booting Puma
=> Rails 6.0.3.1 application starting in production
=> Run `rails server --help` for more startup options
Exiting
A server is already running. Check /app/tmp/pids/server.pid.

but inside a docker container I cannot remove .pid file becuase container never starts.

Please help!

2 Answers

You can remove .pid before running server, add to docker-compose some script before firing up server:

command: bash -c bin/start.sh

File: bin/start.sh

rm -f tmp/pids/server.pid
exec bundle exec rails s -b 0.0.0.0

simply go into the specfied directory of project and delete that server.pid this will solve your problem

Related