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
CLICK HERE to find out more related problems solutions.