Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduction of mailhog #299

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,2 +1,3 @@
.idea
dbdata
dbdata
mails
65 changes: 43 additions & 22 deletions README.md
Expand Up @@ -8,35 +8,56 @@
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FLaracommerce%2Flaracom.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FLaracommerce%2Flaracom?ref=badge_shield)

# Get discount on Digital Ocean

Sign-up with [Digital Ocean and get $10 discount](https://m.do.co/c/bce94237de96)!

# Laravel FREE E-Commerce Software

Features Provided
- Products
- Cart
- Checkout
- Categories
- Customers
- Orders
- Payment
- Couriers
- Employees

- To view more details of the features
See full [documentation](https://jsdecena.github.io/laracom)

- Products
- Cart
- Checkout
- Categories
- Customers
- Orders
- Payment
- Couriers
- Employees

- To view more details of the features
See full [documentation](https://jsdecena.github.io/laracom)

# Simplified DOCKER setup
### In your teminal, issue these commands

- RUN `docker-compose up -d --build`
- If your runtime is apple silicon, use `docker-compose -f docker-compose-m1.yml up -d --build` command
- RUN `docker exec -it app bash`
- Inside the container, run `composer install && chmod -R 777 storage/ bootstrap/cache/`
- Inside the container, run `php artisan migrate --seed`
- While inside the container, compile the assets with `npm i && npm run dev`
- While inside the container, link the images `php artisan storage:link`
- OPEN [http://localhost:8000](http://localhost:8000)
## In your teminal, issue these commands

- RUN `docker-compose up -d --build`
- If your runtime is apple silicon, use `docker-compose -f docker-compose-m1.yml up -d --build` command
- RUN `docker exec -it app bash`
- Inside the container, run `composer install && chmod -R 777 storage/ bootstrap/cache/`
- Inside the container, run `php artisan migrate --seed`
- While inside the container, compile the assets with `npm i && npm run dev`
- While inside the container, link the images `php artisan storage:link`
- OPEN [http://localhost:8000](http://localhost:8000)

## If you want to use mailhog as SMTP

1.Create a ./mails directory
2.change .env like this

```
MAIL_DRIVER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="test@example.com"
MAIL_FROM_NAME="${APP_NAME}"
```

3.Go to http://localhost:8025 and verify that the mailhog screen appears

# Author

Expand All @@ -46,6 +67,6 @@ See full [documentation](https://jsdecena.github.io/laracom)

<a href="https://github.com/jsdecena/laracom/graphs/contributors"><img src="https://opencollective.com/laracom/contributors.svg?width=890" title="contributors" alt="contributors" /></a>


## License

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FLaracommerce%2Flaracom.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FLaracommerce%2Flaracom?ref=badge_large)
14 changes: 14 additions & 0 deletions docker-compose-m1.yml
Expand Up @@ -44,6 +44,20 @@ services:
- ./dbdata:/var/lib/mysql
networks:
- app-network
mailhog:
build: ./mailhog
container_name: mailhog
tty: true
ports:
- "8025:8025"
- "1025:1025"
environment:
MH_STORAGE: maildir
MH_MAILDIR_PATH: /home/mailhog/mails
volumes:
- ./mails:/home/mailhog/mails
networks:
- app-network
networks:
app-network:
driver: bridge
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Expand Up @@ -43,6 +43,20 @@ services:
- ./dbdata:/var/lib/mysql
networks:
- app-network
mailhog:
build: ./mailhog
container_name: mailhog
tty: true
ports:
- "8025:8025"
- "1025:1025"
environment:
MH_STORAGE: maildir
MH_MAILDIR_PATH: /home/mailhog/mails
volumes:
- ./mails:/home/mailhog/mails
networks:
- app-network
networks:
app-network:
driver: bridge
Expand Down
32 changes: 32 additions & 0 deletions mailhog/Dockerfile
@@ -0,0 +1,32 @@
#
# MailHog Dockerfile
#

FROM golang:1.18-alpine as builder

# Install MailHog:
RUN apk --no-cache add --virtual build-dependencies \
git \
&& mkdir -p /root/gocode \
&& export GOPATH=/root/gocode \
&& go install github.com/mailhog/MailHog@latest

FROM alpine:3
# Add mailhog user/group with uid/gid 1000.
# This is a workaround for boot2docker issue #581, see
# https://github.com/boot2docker/boot2docker/issues/581
RUN adduser -D -u 1000 mailhog

COPY --from=builder /root/gocode/bin/MailHog /usr/local/bin/

USER mailhog

WORKDIR /home/mailhog

RUN mkdir ./mails
RUN chmod 644 ./mails

ENTRYPOINT ["MailHog"]

# Expose the SMTP and HTTP ports:
EXPOSE 1025 8025