Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure https-portal and Streamlit - web app #332

Open
dan-adi opened this issue Jan 24, 2023 · 3 comments
Open

Configure https-portal and Streamlit - web app #332

dan-adi opened this issue Jan 24, 2023 · 3 comments

Comments

@dan-adi
Copy link

dan-adi commented Jan 24, 2023

Hello,
I am having trouble configuring https-portal to work with a Streamlit web app deployed with docker.
This is my attempt at a docker-compose.yaml:

version: '3'
services:
  https-portal:
    image: steveltn/https-portal:1
    ports:
      - '80:80'
      - '443:443'
    links:
      - streamlit_app
    restart: always
    environment:
      WEBSOCKET: 'true'
      DOMAINS: 'http://example.go.ro/ -> http://streamlit_app:8501'
      STAGE: production # mantenha em staging até o total funcionamento
    volumes:
      - https-portal-data:/var/lib/https-portal
      
  streamlit_app:
    build:
      dockerfile: ./Dockerfile
      context: ./ 
    volumes:
      - .:/ETCWebApp
    ports:
      - 8501:8501
    restart: always

On my router I have the external ports 80,443 forwarded to internal 8501 port.
Using the docker-compose up, I get no errors, but I can only access my webapp on HTTP not HTTPS.
Any ideas how to make it work?
Thank you

@dan-adi
Copy link
Author

dan-adi commented Jan 24, 2023

This is the error it gives:

Failed to sign clearskies.go.ro.
https-portal_1   | Make sure your DNS is configured correctly and is propagated to this host
https-portal_1   | machine. Sometimes that takes a while.

Any idea how to solve it?

@gerold-penz
Copy link

gerold-penz commented Jan 25, 2023

Hi!

1.) I think, your docker-compose.yaml should look like this:

services:

  streamlit_app:
    build:
      dockerfile: ./Dockerfile
      context: ./ 
    volumes:
      - .:/ETCWebApp
    restart: unless-stopped

  https-portal:
    image: steveltn/https-portal:1.22
    depends_on:
      - streamlit_app
    ports:
      - '80:80'
      - '443:443'
    restart: unless-stopped
    environment:
      WEBSOCKET: 'true'
      DOMAINS: 'example.go.ro -> streamlit_app:8501'
      STAGE: production # mantenha em staging até o total funcionamento
    volumes:
      - https-portal-data:/var/lib/https-portal
      

2.) Your router must forward the ports 80 and 443 to your computer, directly. Not the Port 8501.

Router 80 --> Computer 80
Router 443 --> Computer 443

Maybe it helps.

@dan-adi
Copy link
Author

dan-adi commented Jan 25, 2023

Hi!

1.) I think, your docker-compose.yaml should look like this:

services:

  streamlit_app:
    build:
      dockerfile: ./Dockerfile
      context: ./ 
    volumes:
      - .:/ETCWebApp
    restart: unless-stopped

  https-portal:
    image: steveltn/https-portal:1.22
    depends_on:
      - streamlit_app
    ports:
      - '80:80'
      - '443:443'
    restart: unless-stopped
    environment:
      WEBSOCKET: 'true'
      DOMAINS: 'example.go.ro -> streamlit_app:8501'
      STAGE: production # mantenha em staging até o total funcionamento
    volumes:
      - https-portal-data:/var/lib/https-portal
      

2.) Your router must forward the ports 80 and 443 to your computer, directly. Not the Port 8501.

Router 80 --> Computer 80
Router 443 --> Computer 443

Maybe it helps.

Thank you, it works now.!
The yaml file looks like this:

services:
  streamlit_app:
    build:
      dockerfile: ./Dockerfile
      context: ./ 
    volumes:
      - .:/ETCWebApp
    ports:
      - 8501:8501
    restart: unless-stopped
    
  https-portal:
    image: steveltn/https-portal:1.22
    depends_on:
      - streamlit_app
    ports:
      - '80:80'
      - '443:443'
    restart: unless-stopped
    environment:
      WEBSOCKET: 'true'
      DOMAINS: 'example.go.ro -> streamlit_app:8501'

I also made the router changes you provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants