notifo-io / notifo

Multi channel notification service for collaboration tools, e-commerce, news service and more.
MIT License
744 stars 69 forks source link

How to run docker compose on localhost? #234

Open pancake-boy opened 5 months ago

pancake-boy commented 5 months ago

Things I have tried

  1. In .env, NOTIFO_DOMAIN=localhost
  2. docker compose up
  3. Chrome > visit https://localhost
  4. error in docker console

notifo_proxy-1 | 2024/04/15 07:48:46 http: TLS handshake error from 172.18.0.1:38592: remote error: tls: unknown certificate

image001

SebastianStehle commented 5 months ago

Good question.

The problem is that notifo needs https for authentication. I do not have a setup that just works, because afaik you cannot create a trusted localhost certificate using lets encrypt.

pancake-boy commented 5 months ago

I tried to trust the root cert as documented here: https://caddyserver.com/docs/running#docker-compose But still not working

SebastianStehle commented 5 months ago

Here they use the internal flag, but I am not sure how to apply if dynamically:

https://stackoverflow.com/a/69648452/1229622

pancake-boy commented 5 months ago

Where do I add this “tls internal“ just to try it out?

SebastianStehle commented 5 months ago

The caddy proxy is defined here: https://github.com/Squidex/squidex-hosting/tree/master/docker-compose/proxy-caddy

You have to add the "tls internal" to the Caddyfile.

SebastianStehle commented 5 months ago

I have tested it and added a readme with some instructions: https://github.com/notifo-io/notifo/tree/main/deployment/docker-compose

pancake-boy commented 5 months ago

So you have added SITE_SETTINGS (actually SITE_CUSTOM) to your caddyfile and published caddy-proxy v2.7.6

I have tried the new docker-compose file but still giving me the same error. Strange

pancake-boy commented 5 months ago

At the moment, I resorted to exposing the port for notifo_notifo and use http. It seems to work but not sure what issues I will run into later without https

SebastianStehle commented 5 months ago

Have you read the readme?