ddvk / rmfakecloud

host your own cloud for the remarkable
GNU Affero General Public License v3.0
769 stars 62 forks source link

Howto: https with docker-compose + nginx-proxy #69

Open mooomooo opened 3 years ago

mooomooo commented 3 years ago

Docker-compose and nginx-proxy makes running an https protected server super painless. Perhaps this information can be added to a README or HOWTO somewhere? (c.f. #38, #65)

Once nginx-proxy and acme-companion are set up (see https://github.com/nginx-proxy/acme-companion), define a service in docker-compose.yml as follows:

services:
  rmfakecloud:
    image: ddvk/rmfakecloud
    environment:
        - DATADIR=/data
        - STORAGE_URL=https://rmfakecloud.${DOMAIN}
        - VIRTUAL_HOST=rmfakecloud.${DOMAIN},*.appspot.com,*.remarkable.com
        - LETSENCRYPT_HOST=rmfakecloud.${DOMAIN}
        - LETSENCRYPT_EMAIL=webmaster@${DOMAIN}
        - CERT_NAME=rmfakecloud.${DOMAIN}
    volumes:
        - /data
    networks:
        - proxy

This assumes you've defined DOMAIN in your .env and set up your hosting DNS for rmfakecloud appropriately; those values can be changed to taste. All the standard docker-compose modifications (local or named volumes, restart policy, etc.) apply.

As an aside, would it be possible to tag the images on dockerhub with the release version number in addition to just latest?

grimreaperling commented 3 years ago

Can I ask how to create a docker network "proxy"?I just fail to create the docker container use the same way.

mooomooo commented 3 years ago

The named network is not strictly necessary -- this service just needs to be on the same network as your reverse proxy. The latest instructions at https://github.com/nginx-proxy/acme-companion don't ask for that, but other howtos (e.g. https://cloud.google.com/community/tutorials/nginx-reverse-proxy-docker) explain it in more detail.

ddvk commented 3 years ago

you no longer need nginx for tls, the variables can be set directly (TLS_CERT and TLS_KEY) . have to check if the container has been updated