ned-kelly / docker-multicontainer-libretime

A multi-container deployment of the Libretime Radio Broadcast Server, PostgreSQL, Icecast2 & RabbitMQ, all based on Ubuntu Xenial & Alpine Linux!
56 stars 22 forks source link

LetsEncrypt #26

Closed zeLostchild closed 5 years ago

zeLostchild commented 5 years ago

I am having trouble understand how to add https, with the link that is given. I am a complete novice with docker. Are there any simpler alternatives? Or possibly a guide with step by step instructions?

ned-kelly commented 5 years ago

The easiest option is going to be setting up a reverse proxy (such as Caddy) in front of your Libretime installation, and then proxy passing to the Libretime docker container:

Example Caddyfile:

radio.<your-domain>.com {
  gzip
  log stdout
  errors

  proxy / http://<ip-of-libretime>:8882 {
    transparent
    websocket
    insecure_skip_verify
    header_upstream Host {host}
    header_upstream X-Real-IP {remote}
    header_upstream X-Forwarded-For {remote}
    header_upstream X-Forwarded-Proto {scheme}

    header_upstream Accept-Encoding identity
  }
}

Replace: <ip-of-libretime> with the IP of the host running the libretime docker container -- If it's the same host as the Caddy Docker container, you can use an internal docker container name here - or if unsure, just specify the libretime host's IP (if you're using the host network mode in docker).

zeLostchild commented 5 years ago

When I login from the actual ip it works or when it is not using https.

I tried a using certbot with apache and well... this is essentially what I got when I try in login an error occurs. (I can still use IP address to login)

Here is my apache .conf file

<IfModule mod_ssl.c>
<VirtualHost *:443>
   ProxyPreserveHost On
   ServerName pond.mydomain.org
     ProxyPass / http://0.0.0.0:8882/
     ProxyPassReverse / http://0.0.0.0:8882/

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/pond.mydomain.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/pond.mydomain.org/privkey.pem
</VirtualHost>
</IfModule>

Also I have EXTERNAL_HOSTNAME=pond.mydomain.org for libretime.

Is there something that i need to add to the apache2 .conf file