Docker&Celery - ERROR: Pidfile (celerybeat.pid) already exists
Another solution (taken from https://stackoverflow.com/a/17674248/39296) is to use --pidfile= (with no path) to not create a pidfile at all. Same effect as Siyu's answer above.
I believe there is a pidfile in your project directory ./
then when you run the container, it's mounted in.
(therefore RUN find . -type f -name "celerybeat.pid" -exec rm -f {} \;
had no effect).
You can use celery --pidfile=/opt/celeryd.pid
to specify a non mounted path so that it is not mirror on the host.
Although not professional in the slightest, I found adding:
celerybeat.pid
to my .dockerignore
file was what fixed said issues.