Complete Docker beginner here !
I'm trying to set up a Docker container based on Raspbian Bookworm which installs and runs Beanstalkd. I then want to start a number of PHP processes which communicate with one another via Beanstalk queues. I have this all working outside of Docker.
My Dockerfile looks like this:
# Define base image (Raspbian Bookworm)
FROM dtcooper/raspberrypi-os:latest
# Update
RUN apt update
RUN apt upgrade -y
# Install beanstalkd
RUN apt install -y beanstalkd
# Start Beanstalkd
ENTRYPOINT /usr/bin/beanstalkd -l 0.0.0.0 -p 11300
# Copy over files etc ...
COPY classes/ramdisk.php /myapp/classes/
COPY controller.php /myapp/
# Run controller
CMD ["php", "controller.php"]
Whilst beanstalkd installs it does not run when I run the container. I've tried a variety of ways of solving this included the one shown above from here (Beanstalkd in docker) and also by writing to /usr/sbin/policy-rc.d as described here (How to solve "invoke-rc.d: policy-rc.d denied execution of start." when building a container Ubuntu 14.04 and installing apache2?) but neither solution works. In both cases if I run the container and do:
ps ax | grep beanstalk
no process is running yet if I do:
service beanstalkd start
from the container command line then beanstalkd runs.
From my Dockerfile above you'll see that I want to start beanstalkd and then continue on to run other processes so, as I understand it, using ENTRYPOINT is probably not the best solution but CMD won't start beanstalkd either.
What am I doing wrong ?