Search code examples
dockerdocker-composedockerfileaws-ecs

How to start below services in docker Entrypoint


I want to start below services when container is running.

sudo service celeryd start
sudo service celerybeat start 
service php7.0-fpm start 
service rsyslog start 

Current below command is not working AWS ECS. And throwing some errors.

ENTRYPOINT sudo service celeryd start 
&& sudo service celerybeat start 
&& service php7.0-fpm start 
&& service rsyslog start && bash

Please advise me how to do it

Thanks in advance.


Solution

  • I don't recommend the overall design since you are running multiple apps inside a single container. You have no error handling or feedback if any one service fails to start. That said, fixing your current problem can be done by using a command that won't exit when there is no input.

    ENTRYPOINT service celeryd start \
     && service celerybeat start \
     && service php7.0-fpm start \
     && service rsyslog start \
     && tail -f /dev/null