mailhog-as-docker-container

This commit is contained in:
Krzysztof Szumny 2016-04-10 23:18:38 +02:00
parent dab119a4f3
commit a023ed7a35
2 changed files with 13 additions and 3 deletions

View File

@ -23,12 +23,15 @@ SECRET_KEY = env('DJANGO_SECRET_KEY', default='CHANGEME!!!')
# Mail settings # Mail settings
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
EMAIL_HOST = 'localhost'
EMAIL_PORT = 1025 EMAIL_PORT = 1025
{%if cookiecutter.use_mailhog == 'n' -%} {% if cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'y' %}
EMAIL_HOST = 'mailhog'
{% else %}
EMAIL_HOST = 'localhost'
EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND',
default='django.core.mail.backends.console.EmailBackend') default='django.core.mail.backends.console.EmailBackend')
{%- endif %} {% endif %}
# CACHING # CACHING
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------

View File

@ -42,3 +42,10 @@ services:
links: links:
- postgres - postgres
{% endif %} {% endif %}
{% if cookiecutter.use_mailhog == 'y' %}
mailhog:
image: mailhog/mailhog
ports:
- "8025:8025"
{% endif %}