Sign In
Sign In

Deploy a Celery App

Updated on 14 May 2024

You can find the step-by-step deployment guide here.

Application Build

Hostman uses the following environment when building a Celery application:

  • Python 3.8
  • pip
  • gunicorn
  • System libraries for working with PostgreSQL and MySQL

Hostman will execute the following commands during the build:

apt-get install -y python3 python3-pip gunicorn python3-psycopg2 libpq-dev python-dev default-mysql-client python3-dev default-libmysqlclient-dev python3-mysqldb --fix-missing
pip3 install psycopg2 
ln /usr/bin/python3 /usr/bin/python -sf
ln /usr/bin/pip3 /usr/bin/pip -sf
pip3 install celery

If the project has a requirements.txt file, we will also run:

pip3 install --upgrade -r requirements.txt

The default start command is:

celery -A tasks worker --loglevel=INFO

Make sure the application initialization file is named main.py.

Troubleshooting

Deployment fails

If there are problems with deployment, first check the deployment log. You will be able to determine at what point something went wrong.

Often the problems are related to the start command. Check that everything in your development environment works with gunicorn. Make sure that all modules required to run the application are present in the requirements.txt file.

Was this page helpful?
Updated on 14 May 2024

Do you have questions,
comments, or concerns?

Our professionals are available to assist you at any moment,
whether you need help or are just unsure of where to start.
Email us
Hostman's Support