Skip to content

Commit

Permalink
Added mail service for production.
Browse files Browse the repository at this point in the history
  • Loading branch information
SarahW91 committed Nov 25, 2021
1 parent dd9c95f commit 88cee48
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } # Necessary for Devise mails
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'maildev',
:address => 'mail',
:port => 25,
:openssl_verify_mode => 'none'
}
Expand Down
22 changes: 9 additions & 13 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,18 @@
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "gbo_lapp_#{Rails.env}"

config.action_mailer.perform_caching = false
# config.action_mailer.perform_caching = false

# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
config.action_mailer.raise_delivery_errors = true

config.action_mailer.default_url_options = { host: ENV['PROJECT_DOMAIN'] } # Necessary for Devise mails
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'mail',
:port => 25
}

# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
Expand All @@ -91,15 +98,4 @@

# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false

# For Devise
config.action_mailer.default_url_options = { host: ENV['PROJECT_DOMAIN'] }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: '127.0.0.1',
port: 25,
domain: ENV['PROJECT_DOMAIN'],
tls: false,
enable_starttls_auto: false
}
end
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
services:
maildev:
mail:
image: djfarrelly/maildev
ports:
- "1080:80"
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ services:
ports:
- ${PORT}:${PORT}

mail:
image: boky/postfix:latest
environment:
ALLOWED_SENDER_DOMAINS: ${PROJECT_DOMAIN}
ports:
- '1578:578'

volumes:
bwm-redis:
bwm-postgres:

0 comments on commit 88cee48

Please sign in to comment.