Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Docker/ MetaBase SSL setup
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Docker/ MetaBase SSL setup

I have installed Docker on centos 7.2. I have installed MetaBase image. All is working great. I need to secure the URL. I generated a SSL certificate using letsEncrypt. How do I setup Docker/ Metabase to listen and serve https?

Any help / pointers appreciated.

Comments

  • Instead of -p 3000:3000, do -p 127.0.0.1:3000:3000

    Then setup nginx as a reverse proxy that listens to your public ip and forwards to 127.0.0.1:3000. You'll setup the SSL termination on nginx and you're done.

  • @deadbeef said:
    Instead of -p 3000:3000, do -p 127.0.0.1:3000:3000

    Then setup nginx as a reverse proxy that listens to your public ip and forwards to 127.0.0.1:3000. You'll setup the SSL termination on nginx and you're done.

    Thank you. Would you happen to have a tutorial or something which can guide me through this setup?

  • edited June 2016

    @plumberg said:

    @deadbeef said:
    Instead of -p 3000:3000, do -p 127.0.0.1:3000:3000

    Then setup nginx as a reverse proxy that listens to your public ip and forwards to 127.0.0.1:3000. You'll setup the SSL termination on nginx and you're done.

    Thank you. Would you happen to have a tutorial or something which can guide me through this setup?

    Use jwilder/nginx-proxy

    For port: https://github.com/jwilder/nginx-proxy#multiple-ports

    For SSL: https://github.com/jwilder/nginx-proxy#ssl-support

    Might be useful to setup a docker-compose.yml for your app, and another for jwilder/nginx-proxy so that VIRTUAL_HOST and VIRTUAL_PORT env vars, along with SSL certificate folders are set with just a docker-compose up -d

    Maybe something like this for jwilder/nginx-proxy:

    sys:
      container_name: nginx
      image: jwilder/nginx-proxy
      restart: always
      tty: true
      ports:
        - "80:80"
      volumes:
        - /var/run/docker.sock:/tmp/docker.sock:ro
        - certs:/etc/nginx/certs
    

    with the certs folder containing the certificates in the same directory as docker-compose.yml for jwilder/nginx-proxy

    Maybe something like this for your app:

    sys:
      container_name: metabase
      image: metabase/metabase
      restart: always
      tty: true
      environment:
        - VIRTUAL_HOST=myapp.lowendtalk.com
        - VIRTUAL_PORT=3000
    
    Thanked by 1deadbeef
  • @ALinuxNinja said:

    @plumberg said:

    @deadbeef said:
    Instead of -p 3000:3000, do -p 127.0.0.1:3000:3000

    Then setup nginx as a reverse proxy that listens to your public ip and forwards to 127.0.0.1:3000. You'll setup the SSL termination on nginx and you're done.

    Thank you. Would you happen to have a tutorial or something which can guide me through this setup?

    Use jwilder/nginx-proxy

    For port: https://github.com/jwilder/nginx-proxy#multiple-ports

    For SSL: https://github.com/jwilder/nginx-proxy#ssl-support

    Might be useful to setup a docker-compose.yml for your app, and another for jwilder/nginx-proxy so that VIRTUAL_HOST and VIRTUAL_PORT env vars, along with SSL certificate folders are set with just a docker-compose up -d

    Maybe something like this for jwilder/nginx-proxy:

    sys:
      container_name: nginx
      image: jwilder/nginx-proxy
      restart: always
      tty: true
      ports:
        - "80:80"
      volumes:
        - /var/run/docker.sock:/tmp/docker.sock:ro
        - certs:/etc/nginx/certs
    

    with the certs folder containing the certificates in the same directory as docker-compose.yml for jwilder/nginx-proxy

    Maybe something like this for your app:

    sys:
      container_name: metabase
      image: metabase/metabase
      restart: always
      tty: true
      environment:
        - VIRTUAL_HOST=myapp.lowendtalk.com
        - VIRTUAL_PORT=3000
    

    This is superb. It took me a couple of tries, but, I think I have got it working... (without docker-compose.yml for now). I am still getting comfortable with the whole docker thingi. Thanks again.

Sign In or Register to comment.