mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-01-24 08:14:13 +03:00
Merge pull request #2433 from demestav/master
Flower now served by Traefik
This commit is contained in:
commit
48f7a4a7d2
|
@ -25,7 +25,9 @@ Provided you have opted for Celery (via setting ``use_celery`` to ``y``) there a
|
||||||
|
|
||||||
* ``celeryworker`` running a Celery worker process;
|
* ``celeryworker`` running a Celery worker process;
|
||||||
* ``celerybeat`` running a Celery beat process;
|
* ``celerybeat`` running a Celery beat process;
|
||||||
* ``flower`` running Flower_ (for more info, check out :ref:`CeleryFlower` instructions for local environment).
|
* ``flower`` running Flower_.
|
||||||
|
|
||||||
|
The ``flower`` service is served by Traefik over HTTPS, through the port ``5555``. For more information about Flower and its login credentials, check out :ref:`CeleryFlower` instructions for local environment.
|
||||||
|
|
||||||
.. _`Flower`: https://github.com/mher/flower
|
.. _`Flower`: https://github.com/mher/flower
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,11 @@ entryPoints:
|
||||||
web-secure:
|
web-secure:
|
||||||
# https
|
# https
|
||||||
address: ":443"
|
address: ":443"
|
||||||
|
{%- if cookiecutter.use_celery == 'y' %}
|
||||||
|
|
||||||
|
flower:
|
||||||
|
address: ":5555"
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
certificatesResolvers:
|
certificatesResolvers:
|
||||||
letsencrypt:
|
letsencrypt:
|
||||||
|
@ -41,6 +46,17 @@ http:
|
||||||
tls:
|
tls:
|
||||||
# https://docs.traefik.io/master/routing/routers/#certresolver
|
# https://docs.traefik.io/master/routing/routers/#certresolver
|
||||||
certResolver: letsencrypt
|
certResolver: letsencrypt
|
||||||
|
{%- if cookiecutter.use_celery == 'y' %}
|
||||||
|
|
||||||
|
flower-secure-router:
|
||||||
|
rule: "Host(`{{ cookiecutter.domain_name }}`)"
|
||||||
|
entryPoints:
|
||||||
|
- flower
|
||||||
|
service: flower
|
||||||
|
tls:
|
||||||
|
# https://docs.traefik.io/master/routing/routers/#certresolver
|
||||||
|
certResolver: letsencrypt
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
middlewares:
|
middlewares:
|
||||||
redirect:
|
redirect:
|
||||||
|
@ -52,13 +68,20 @@ http:
|
||||||
# https://docs.traefik.io/master/middlewares/headers/#hostsproxyheaders
|
# https://docs.traefik.io/master/middlewares/headers/#hostsproxyheaders
|
||||||
# https://docs.djangoproject.com/en/dev/ref/csrf/#ajax
|
# https://docs.djangoproject.com/en/dev/ref/csrf/#ajax
|
||||||
headers:
|
headers:
|
||||||
hostsProxyHeaders: ['X-CSRFToken']
|
hostsProxyHeaders: ["X-CSRFToken"]
|
||||||
|
|
||||||
services:
|
services:
|
||||||
django:
|
django:
|
||||||
loadBalancer:
|
loadBalancer:
|
||||||
servers:
|
servers:
|
||||||
- url: http://django:5000
|
- url: http://django:5000
|
||||||
|
{%- if cookiecutter.use_celery == 'y' %}
|
||||||
|
|
||||||
|
flower:
|
||||||
|
loadBalancer:
|
||||||
|
servers:
|
||||||
|
- url: http://flower:5555
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
providers:
|
providers:
|
||||||
# https://docs.traefik.io/master/providers/file/
|
# https://docs.traefik.io/master/providers/file/
|
||||||
|
|
|
@ -42,6 +42,9 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "0.0.0.0:80:80"
|
- "0.0.0.0:80:80"
|
||||||
- "0.0.0.0:443:443"
|
- "0.0.0.0:443:443"
|
||||||
|
{%- if cookiecutter.use_celery == 'y' %}
|
||||||
|
- "0.0.0.0:5555:5555"
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:5.0
|
image: redis:5.0
|
||||||
|
@ -60,8 +63,6 @@ services:
|
||||||
flower:
|
flower:
|
||||||
<<: *django
|
<<: *django
|
||||||
image: {{ cookiecutter.project_slug }}_production_flower
|
image: {{ cookiecutter.project_slug }}_production_flower
|
||||||
ports:
|
|
||||||
- "5555:5555"
|
|
||||||
command: /start-flower
|
command: /start-flower
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user