Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for compose env vars (#532) #533

Merged
merged 3 commits into from
Apr 11, 2022
Merged
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
15 changes: 15 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# CELERY
# -----------------------------------------------------------------------------
# CELERY_BROKER_URL=amqp://guest:guest@rabbitmq:5672/

# DJANGO
# -----------------------------------------------------------------------------
DJANGO_PORT=58000
DJANGO_HOST=127.0.0.1

# RABBITMQ
# -----------------------------------------------------------------------------
# RABBITMQ_HOST=
# RABBITMQ_PASSWORD=
RABBITMQ_PORT=5672
# RABBITMQ_USER=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ coverage.xml
.eggs/
.python-version
venv
.env
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ services:
context: .
dockerfile: docker/django/Dockerfile
ports:
- "127.0.0.1:58000:8000"
- "${DJANGO_HOST:-127.0.0.1}:${DJANGO_PORT:-58000}:8000"
entrypoint: ["/app/docker/django/entrypoint.sh"]
command: ["python3", "manage.py", "runserver", "0.0.0.0:8000"]
command: ["python3", "manage.py", "runserver", "0.0.0.0:${DJANGO_PORT:-8000}"]
tty: true
volumes:
- './django_celery_beat/:/app/django_celery_beat/'
Expand All @@ -36,7 +36,7 @@ services:
dockerfile: docker/celery-beat/Dockerfile
entrypoint: ["/app/docker/celery-beat/entrypoint.sh"]
environment:
CELERY_BROKER_URL: 'amqp://guest:guest@rabbit:5672'
CELERY_BROKER_URL: 'amqp://${RABBITMQ_USER:-guest}:${RABBITMQ_PASSWORD:-guest}@${RABBITMQ_HOST:-rabbit}:${RABBITMQ_PORT:-5672}'
command: ["python3", '-m', "celery", "-A", "mysite", "beat", "-l", "info", "--scheduler", "django_celery_beat.schedulers:DatabaseScheduler"]
tty: true
volumes:
Expand All @@ -45,7 +45,7 @@ services:
rabbit:
image: rabbitmq
ports:
- "5672:5672"
- "${RABBITMQ_PORT:-5672}:5672"
postgres:
image: postgres
environment:
Expand Down
2 changes: 1 addition & 1 deletion issue_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Summary:

Include a *brief* descrioption of the problem here, and fill out the version info below.
Include a *brief* description of the problem here, and fill out the version info below.

* Celery Version:
* Celery-Beat Version:
Expand Down