mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-09 06:24:52 +03:00
Integrate Flower with Docker Compose setup locally
This commit is contained in:
parent
b069f8e40e
commit
4810d57da9
|
@ -65,7 +65,7 @@ Optional Integrations
|
|||
*These features can be enabled during initial project setup.*
|
||||
|
||||
* Serve static files from Amazon S3 or Whitenoise_
|
||||
* Configuration for Celery_
|
||||
* Configuration for Celery_ and Flower_ (the latter in Docker setup only)
|
||||
* Integration with MailHog_ for local email testing
|
||||
* Integration with Sentry_ for error logging
|
||||
|
||||
|
@ -78,6 +78,7 @@ Optional Integrations
|
|||
.. _Mailgun: http://www.mailgun.com/
|
||||
.. _Whitenoise: https://whitenoise.readthedocs.io/
|
||||
.. _Celery: http://www.celeryproject.org/
|
||||
.. _Flower: https://github.com/mher/flower
|
||||
.. _Anymail: https://github.com/anymail/django-anymail
|
||||
.. _MailHog: https://github.com/mailhog/MailHog
|
||||
.. _Sentry: https://sentry.io/welcome/
|
||||
|
|
|
@ -27,6 +27,10 @@ COPY ./compose/local/django/start /start
|
|||
RUN sed -i 's/\r//' /start
|
||||
RUN chmod +x /start
|
||||
{% if cookiecutter.use_celery == "y" %}
|
||||
COPY ./compose/local/django/celery/flower/start /start-flower
|
||||
RUN sed -i 's/\r//' /start-flower
|
||||
RUN chmod +x /start-flower
|
||||
|
||||
COPY ./compose/local/django/celery/worker/start /start-celeryworker
|
||||
RUN sed -i 's/\r//' /start-celeryworker
|
||||
RUN chmod +x /start-celeryworker
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
set -o nounset
|
||||
set -o xtrace
|
||||
|
||||
|
||||
celery flower -A {{cookiecutter.project_slug}}.taskapp worker --broker="${CELERY_BROKER_URL}"
|
|
@ -44,6 +44,12 @@ services:
|
|||
{%- endif %}
|
||||
{%- if cookiecutter.use_celery == 'y' %}
|
||||
|
||||
flower:
|
||||
<<: *django
|
||||
ports:
|
||||
- "5555:5555"
|
||||
command: /start-flower
|
||||
|
||||
redis:
|
||||
image: redis:3.2
|
||||
|
||||
|
|
|
@ -8,6 +8,9 @@ psycopg2==2.7.4 --no-binary psycopg2 # https://github.com/psycopg/psycopg2
|
|||
{%- else %}
|
||||
psycopg2-binary==2.7.4 # https://github.com/psycopg/psycopg2
|
||||
{%- endif %}
|
||||
{%- if cookiecutter.use_docker == 'y' and cookiecutter.use_celery == 'y' %}
|
||||
flower==0.9.2 # https://github.com/mher/flower
|
||||
{%- endif %}
|
||||
|
||||
# Testing
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user