Sign inSign up

thinkcubedev/celery

By thinkcubedev

•Updated 9 months ago

Image
0

161

thinkcubedev/celery repository overview

⁠DockerCelery

This is a simple Docker setup for running Celery workers with Python 3.12.

⁠Files

  • Dockerfile – defines a Python 3.12 image with Celery installed.
  • requirements.txt – Python dependencies.
  • WORKDIR /app – working directory in the container.

⁠Build the Docker image

docker build -t docker-celery .

⁠Run the Celery worker

docker run -it -v $(pwd):/app docker-celery

The container will start a Celery worker using the tasks.py file in /app.

⁠Adding your tasks

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.

⁠Notes

  • You can override the default CMD to run different commands in the container.
  • Non-root user celeryuser is used for security.

Tag summary

Content type

Image

Digest

sha256:e82c4fce2…

Size

109 MB

Last updated

9 months ago

docker pull thinkcubedev/celery:20251231