Skip to content

Commit a77ed3e

Browse files
authored
Merge pull request #2 from skonik/feature/add-mailhog
feature(mailhog): add email testing tool to docker-compose
2 parents 9d4f646 + 51c7bce commit a77ed3e

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Template for Django projects based on:
1818
- [`pytest`](https://docs.pytest.org/en/6.2.x/) with basic setup
1919
- Basic dependencies such `django`, `djangorestframework` etc.
2020
- `docker-compose` infrastructure file with database ([PostgreSQL](https://www.postgresql.org)) and cache ([Redis](https://redis.io)).
21+
- [mailhog](https://github.com/mailhog/MailHog) for testing emails
2122
- Dockerfile for application deployment
2223
- Settings based on environment variables.
2324
- Health check endpoint at `/health`
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from settings.base import *
22

3-
43
DEBUG = True
54

65
ALLOWED_HOSTS = ["*"]
6+
7+
EMAIL_HOST = 'localhost'
8+
EMAIL_PORT = '1025'

{{cookiecutter.project_name}}/docker-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ services:
55
image: postgres:13.2
66
container_name: {{cookiecutter.project_name}}-database
77
restart: always
8+
volumes:
9+
- {{cookiecutter.project_name}}-postgresql:/var/lib/postgresql/data
810
environment:
911
POSTGRES_PASSWORD: {{cookiecutter.project_name}}
1012
POSTGRES_USER: {{cookiecutter.project_name}}
@@ -18,3 +20,17 @@ services:
1820
restart: always
1921
ports:
2022
- "6379:6379"
23+
24+
# Email testing
25+
mailhog:
26+
image: mailhog/mailhog:v1.0.1
27+
container_name: { { cookiecutter.project_name } }-mailhog
28+
volumes:
29+
- ./docker-maildir:/maildir
30+
command: [ "-storage=maildir", "-maildir-path=/maildir" ]
31+
ports:
32+
- '1025:1025'
33+
- '8025:8025'
34+
35+
volumes:
36+
{{cookiecutter.project_name}}-postgresql:

0 commit comments

Comments
 (0)