huey Docker & Self-Hosted Deployment

GitHub

A little task queue for python

5,995 stars Python Python 1 file ยท ~56,472 tokens #dank#django#python#queue#redis#task-queue
RAW Compose
1. Pull Image (DOCKERHUB) docker pull library/redis
2. Docker Run (1-Click Launch) docker run -d --name huey --restart always redis:7-alpine
3. Podman Run podman run -d --name huey --restart always redis:7-alpine
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/library/redis:7-alpine
5. ORAS Pull (OCI Artifact) oras pull redis:7-alpine
6. Compose Deployment docker compose up -d
examples/deploy/compose.yaml
Download .yml
services:
  redis:
    image: redis:7-alpine
    volumes:
      - redis-data:/data

  web:
    build: .
    command: ["gunicorn", "my_app.wsgi"]
    environment:
      REDIS_HOST: redis
    depends_on:
      - redis

  # The worker is built from the same image as the web app, so both see the
  # same code and the same task registry.
  worker:
    build: .
    # NOTE: if you scale this service, add "-n" here and run a single
    # separate service (without "-n") to enqueue periodic tasks.
    command: ["huey_consumer", "my_app.huey", "-w", "4", "-g", "TERM", "-t", "55"]
    environment:
      REDIS_HOST: redis
    depends_on:
      - redis
    # SIGKILL deadline for a graceful shutdown (default 10s). The consumer's
    # -t 55 interrupts still-running tasks just before this.
    stop_grace_period: 60s

volumes:
  redis-data: