diff --git a/.gitignore b/.gitignore index 89a2da9b..707ea66d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea -dbdata \ No newline at end of file +dbdata +mails \ No newline at end of file diff --git a/README.md b/README.md index ba84c5cd..b9f2ebfd 100644 --- a/README.md +++ b/README.md @@ -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 @@ -46,6 +67,6 @@ See full [documentation](https://jsdecena.github.io/laracom) contributors - ## 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) diff --git a/docker-compose-m1.yml b/docker-compose-m1.yml index befca453..d2a15e05 100644 --- a/docker-compose-m1.yml +++ b/docker-compose-m1.yml @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index a0ccfd8e..ab28ec1a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/mailhog/Dockerfile b/mailhog/Dockerfile new file mode 100644 index 00000000..062d91c6 --- /dev/null +++ b/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 \ No newline at end of file