-
Notifications
You must be signed in to change notification settings - Fork 12
Docker Setup using log
mailer (some gotchas)
#273
Comments
Thanks for the very detailed instructions. We appreciate it. We know the current process is not super ideal, and we'll improve it so the Docker installation is easier to use. |
I've been playing around with the builds and I think the dockerfile can be optimized to build waaay faster using the --cache-from flag. It would require ordering some of the COPY operations so the minor source changes are the last stuff that gets copied. That way the entire container doesn't need a rebuild every time I change a tiny bit of code. I'm gonna play around with this because it really speeds up the development loop (just the initial caching that already works by default cut my build time by 60%). |
The issue with the Mailer are not related to the docker image. |
I don't see this as an issue per see, just wrote a description of the process because it took some work to set it up. I tried disabling email confirmation in the correct PHP middlewareish file, but it didn't do anything, just made the app throw 500. Btw, I feel a lot of the grunt work and minor issues (based on the current issues on monica) will be frontend stuff in the future. (minor broken layouts, mixed up copy etc) @asbiin |
@njelich if you use macOS, setting up Valet makes creating the dev environment a breeze and would deal with PHP and so on. As soon as you have ngninx and PHP working, it's super easy to do dev work. I don't know how you could use the Docker image to actually do dev work. If you successfully make it work, after the usual I have no idea if this helps you in any way, though. |
A docker compose is usually the way a local environment is set up. |
The email is encoded as quoted-printable so have it go through a decoder will give you the correct URL as well. |
Hey guys!
Setting up Docker locally had some unexpected gotchas, so I'd like to just leave a few tips for those new to the flow. This guide continues from the "docker installed, image builds and runs okay point" - meaning you've successfully ran the following commands:
docker build -t monica-next -f scripts/docker/Dockerfile .
docker run --name monica-p 8080:80 -e MAIL_MAILER=log monica-next
Registration
After this point you'll be faced with the login screen, where you have to register.
Mail verification
Great, you filled out the registration info and got to the verification mail stage. So where do you find the verification mail?
In my case it is delivered to the Docker Desktop log handler - so open up Docker desktop, pick Containers from the nav bar on the left and click on your
monica
container.Here you can see part of the raw mail HTML being sent to the log mailer. The part containing the verification URL is obfuscated - however, we have
=
at the end of each line and a few other bits we need to remove before this works fine.http://localh= ost:8080/email/verify/2/4b8e02cde907e88a3f481928de3e3cc6ca61686c?expires=3D= 1667212743&signature=3Dd545eebd0f5fdff467acb06d2ed4e29f6dd0e255e66c9ffb= 1274fb01a2dcda1a
To clean this up we need to remove the
=
that were added as line ends, remove the newlines that are unnecessary, replace&
with&
and (this is a tricky one) remove the3D
aftersignature=
andexpires=
.Then we can copy the raw verification url and paste it into the browser to actually get into the app.
http://localhost:8080/email/verify/2/4b8e02cde907e88a3f481928de3e3cc6ca61686c?expires=1667212743&signature=d545eebd0f5fdff467acb06d2ed4e29f6dd0e255e66c9ffb1274fb01a2dcda1a
Congrats, now you have a basic development/usage loop using a locally built docker container.
NOTE: I'll hopefully write a docker-sync setup for development without rebuilding the container soon, making contributing without setting up your local system possible
The text was updated successfully, but these errors were encountered: