This is a simple Docker setup for running Celery workers with Python 3.12.
Dockerfile – defines a Python 3.12 image with Celery installed.requirements.txt – Python dependencies.WORKDIR /app – working directory in the container.docker build -t docker-celery .
docker run -it -v $(pwd):/app docker-celery
The container will start a Celery worker using the tasks.py file in /app.
Create a tasks.py file in the project directory:
from celery import Celery
app = Celery('tasks', broker='redis://redis:6379/0')
@app.task
def add(x, y):
return x + y
Make sure to have a running broker (like Redis) to connect Celery to.
celeryuser is used for security.Content type
Image
Digest
sha256:e82c4fce2…
Size
109 MB
Last updated
9 months ago
docker pull thinkcubedev/celery:20251231