Skip to content

Commit

Permalink
feat(settings): email configs and smtp4dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamad-liyaghi committed Jul 31, 2024
1 parent c4c2930 commit d040f2f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/settings/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,11 @@
},
}
}

# Email configs
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST = config("EMAIL_HOST")
EMAIL_HOST_USER = config("EMAIL_USER")
EMAIL_HOST_PASSWORD = config("EMAIL_PASSWORD")
EMAIL_PORT = config("EMAIL_PORT")
DEFAULT_FROM_EMAIL = config("EMAIL_FROM")
13 changes: 13 additions & 0 deletions docker-compose.base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ services:
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
postgres:
restart: on-failure
container_name: food-anywhere-postgres
Expand Down Expand Up @@ -43,6 +45,17 @@ services:
interval: 2s
timeout: 5s
retries: 5
smtp4dev:
image: rnwood/smtp4dev:v3
restart: always
container_name: food-anywhere-smtp4dev
ports:
- "5000:80"
expose:
- "25"
networks:
- main


networks:
main:
4 changes: 4 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ services:
extends:
service: redis
file: docker-compose.base.yaml
smtp4dev:
extends:
service: smtp4dev
file: docker-compose.base.yaml

networks:
main:
Expand Down
7 changes: 7 additions & 0 deletions envs/.env.local
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ POSTGRES_PORT=5432

# Redis
CACHE_DB_URL='redis://redis:6379/2'

# Email
EMAIL_HOST='smtp4dev'
EMAIL_USER=''
EMAIL_PASSWORD=''
EMAIL_PORT=25
EMAIL_FROM='support@FoodAnywhere.com'
7 changes: 7 additions & 0 deletions envs/.env.prod
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ POSTGRES_PORT=5432

# Redis
CACHE_DB_URL='redis://redis:6379/2'

# Email
EMAIL_HOST='MAILSERVER'
EMAIL_USER=''
EMAIL_PASSWORD=''
EMAIL_PORT=25
EMAIL_FROM='support@FoodAnywhere.com'

0 comments on commit d040f2f

Please sign in to comment.