UPDATE:
Per OP, elastic beanstalk is being used so modified response
Create a new directory called .ebextensions
in your codes root folder
Within that folder add a file <your file name>.config
and ad the following contents
commands:
create_post_dir:
command: "mkdir -p /opt/elasticbeanstalk/hooks/appdeploy/post"
ignoreErrors: true
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/start_celery.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
celery -A my_project worker -l info
NOTE: There could be more to this depending on what other configs, envs, or installations celery needs to start properly. But at least this should get you started.