Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Commit

Permalink
docker: use maildev for smtp trap service, fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
jgauthi committed Jun 18, 2023
1 parent 4a8d0bf commit 2d87052
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
###< symfony/messenger ###

###> symfony/mailer ###
# MAILER_DSN=null://null
MAILER_DSN=smtp://mailer:1025
###< symfony/mailer ###
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* The JSON extension must be enabled
* The Ctype extension must be enabled
* The date.timezone parameter must be defined in php.ini
* Docker & Docker-compose

More information on [symfony website](https://symfony.com/doc/6.2/reference/requirements.html).

Expand All @@ -17,11 +18,9 @@ Messenger provides a message bus with the ability to send messages and then hand
Command lines:

```bash
# clone current repot
composer install

# (optional) Copy and edit configuration values ".env.local"
# Edit "MAILER_DSN" in .env.local with SMTP service (example: mailtrap)

php bin/console doctrine:database:create
php bin/console doctrine:migrations:migrate -n
Expand All @@ -33,12 +32,18 @@ php bin/console doctrine:fixtures:load -n
Just execute this command to run the built-in web server _(require [symfony installer](https://symfony.com/download))_ and access the application in your browser at <http://localhost:8000>:

```bash
docker-compose up -d
symfony server:start

# Launch Messages service
symfony console messenger:consume async

# For stop services
docker-compose stop && symfony server:stop
```

For look at emails send by the smtp service, look at this url <http://localhost:1080> (maildev).

Debug commands:

```shell
Expand Down
8 changes: 0 additions & 8 deletions docker-compose.override.yml

This file was deleted.

7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3.6'
services:
mailer:
image: maildev/maildev
ports:
- "1080:1080"
- "1025:1025"
1 change: 1 addition & 0 deletions templates/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<div class="collapse navbar-collapse">
<ul class="navbar-nav me-auto mb-2 mb-md-0">
<li class="nav-item"><a class="nav-link active" href="{{ path('dossierList') }}">Index</a></li>
<li class="nav-item"><a class="nav-link" href="http://localhost:1080" target="_blank">Mailer</a></li>
<li class="nav-item"><a class="nav-link" href="//symfony.com/doc/current/">Symfony Doc</a></li>
{% block menu %}{% endblock %}
{% if not app.user %}
Expand Down

0 comments on commit 2d87052

Please sign in to comment.