Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

テストメール環境のためmailコンテナを追加 #8

Merged
merged 1 commit into from May 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Expand Up @@ -8,3 +8,4 @@ MYSQL_DATABASE=homestead
MYSQL_USER=homestead
MYSQL_PASSWORD=secret
MYSQL_ROOT_PASSWORD=secret
MAILHOG_PORT=3504
13 changes: 13 additions & 0 deletions README.md
Expand Up @@ -53,6 +53,19 @@ $ sed -i -e "s/DB_HOST=.*/DB_HOST=db-testing/" .env.testing
$ ./vendor/bin/phpunit
```

### Send Test Mail

```
$ docker-compose exec app ash
$ sed -i -e "s/MAIL_HOST=.*/MAIL_HOST=mail/" .env
$ sed -i -e "s/MAIL_PORT=.*/MAIL_PORT=1025/" .env

$ php artisan tinker
Mail::raw('test mail',function($message){$message->to('test@example.com')->subject('test');});
```

http://127.0.0.1:3504

## As necessary

### Login shell of the app container
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.yml
Expand Up @@ -59,6 +59,11 @@ services:
redis:
image: redis:alpine

mail:
image: mailhog/mailhog
ports:
- ${MAILHOG_PORT}:8025

volumes:
db-data:
driver: local