Skip to content

Commit

Permalink
#79: Install mhsendmail and configure PHP to use it
Browse files Browse the repository at this point in the history
We use a builder ourselves as the releases do not have an arm64 binary.
See: mailhog/mhsendmail#28 (comment)
  • Loading branch information
ercanozkaya committed May 31, 2022
1 parent 2aae510 commit f8e14a4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# --- DO NOT MODIFY ---------------------------------------------------------------------------------------------------

##
# Stage: mhsendmail builder
#
# Build mhsendmail in Go again as the releases don't include arm64 binaries.
# See: https://github.com/mailhog/mhsendmail/issues/28#issuecomment-1001176278
##

FROM golang:1.15 AS builder
ARG TARGETARCH
RUN go get -d -v github.com/mailhog/mhsendmail \
&& cd /go/src/github.com/mailhog/mhsendmail/ \
&& GOOS=linux GOARCH=$TARGETARCH go build -o mhsendmail .

##
# Stage: base
#
Expand Down Expand Up @@ -86,6 +99,10 @@ ENTRYPOINT ["/init"]
##
FROM build

# Copy mhsendmail from the builder
COPY --from=builder /go/src/github.com/mailhog/mhsendmail/mhsendmail /usr/bin/mhsendmail
RUN chmod +x /usr/bin/mhsendmail

ENV APP_DATA=/srv/www \
APP_ROOT=/var/www \
APP_USER=www-data
Expand Down
6 changes: 5 additions & 1 deletion config/console/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ globals:
mysql-login: "admin:admin"
restart-command: s6-svc -r /var/run/s6/services/apache
vhost: false
projects-dir: /mnt/dev/joomlatools
projects-dir: /mnt/dev/joomlatools
"site:create":
options: /root/.joomlatools/console/site-configuration.yaml
"site:configure":
options: /root/.joomlatools/console/site-configuration.yaml
1 change: 1 addition & 0 deletions config/console/site-configuration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mailer: mail
4 changes: 3 additions & 1 deletion config/php/conf-available/app-development.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

expose_php = on

memory_limit = 128M
sendmail_path = "/usr/bin/mhsendmail --smtp-addr=mailhog:1025"
memory_limit = 256M

post_max_size = 100M
upload_max_filesize = 100M

Expand Down

0 comments on commit f8e14a4

Please sign in to comment.