Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env-file
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CELERY_ACCEPT_CONTENT="json,pickle,application/json,application/x-python-serialize"
CE_BROKER_URL="rabbitmq"
CE_GENERIC_HOSTNAME_TASK_SENT_METRIC="true"
3 changes: 3 additions & 0 deletions .env-file.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CELERY_ACCEPT_CONTENT=
CE_BROKER_URL=
CE_GENERIC_HOSTNAME_TASK_SENT_METRIC=
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM python:3.10-slim-bullseye

EXPOSE 9808
ENV PYTHONUNBUFFERED 1
ENV CELERY_ACCEPT_CONTENT "json"

WORKDIR /app/
COPY pyproject.toml poetry.lock /app/
Expand All @@ -19,4 +20,4 @@ RUN apt-get update && \

COPY . /app/

ENTRYPOINT ["python", "/app/cli.py"]
ENTRYPOINT python /app/cli.py --accept-content=${CELERY_ACCEPT_CONTENT}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ Using Docker:
docker run -p 9808:9808 danihodovic/celery-exporter --broker-url=redis://redis.service.consul/1
```

Using Docker Compose:
```sh
docker-compose build && docker-compose -p celery-exporter up -d
```

Using the Python binary (for-non Docker environments):
```sh
curl -L https://github.com/danihodovic/celery-exporter/releases/download/latest/celery-exporter -o ./celery-exporter
Expand Down
27 changes: 21 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
---
version: '2.4'
version: "3.9"
services:
redis:
image: 'redis:6'
ports: ['6379:6379']

celery-exporter:
container_name: celery-exporter
build: .
env_file:
- .env-file
ports:
- "9808:9808"
depends_on:
- rabbitmq
restart: unless-stopped
rabbitmq:
container_name: rabbitmq
image: rabbitmq:3
ports: ['5672:5672']
ports:
- "5672:5672"
restart: unless-stopped
redis:
container_name: redis
image: redis:6
ports:
- "6379:6379"
restart: unless-stopped