dockerdocker-composedevops-servicesstellar.jshorizon

How to run docker application over a secure server using letsencrypt?


Need to start Horizon server over a secure network. Using this github repo https://github.com/stellar/docker-stellar-core-horizon

Following README doc I tried,

    docker run --rm -it -p "8000:8000" --name stellar stellar/quickstart --testnet

this start my horizon app over port 8000 with http server. I need to run over https server. For this I tried out few things like,

    docker run --rm -it -p "8000:443" --name stellar stellar/quickstart --testnet 

    docker run --rm -it -p "8000:8000" --name stellar stellar/quickstart --testnet docker --tlsverify --tlscacert=ca.pem --tlscert=cert.pem --tlskey=key.pem 

And few more with these ssl keys. Tried to redirect https calls from server to http call using nginx, however failed to do so.

Please provide a way to start docker container over a secure server.


Solution

  • What i ahd learned so far is that we cant run docker over a secure server. Docker just ask for a port over which it will provide services. Solution is simple application which is using docker needed to be secure. Over here i was not able to understand this docker application so i used nginx for this.

    My nginx file loocked like somewhat like this

    server {
      listen 9000 ssl;
      server_name 127.0.0.1;
    
    ssl_certificate /etc/letsencrypt/live/staging.globalblockchain.io/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/staging.globalblockchain.io/privkey.pem; # managed by Certbot
    
    
      location / {
        proxy_pass http://127.0.0.1:8000;
      }
    }

    Whai i did is, used nginx to redirect calls over secure 9000 to my local 8000. So all my content over 8000 port was available over secure 9000 and UI was able to use this secure 9000.