SteveLTN / https-portal

A fully automated HTTPS server powered by Nginx, Let's Encrypt and Docker.
MIT License
4.48k stars 297 forks source link

Multiple Apps support #335

Open DilLip-Chowdary-Codes opened 1 year ago

DilLip-Chowdary-Codes commented 1 year ago

@SteveLTN

Can we add more containers in the same host, something like modifying the ports (9443 instead of 443, 9080 instead of 80)

Like below:

Default Container:

version: '3'

services:
  https-portal:
    image: steveltn/https-portal:1
    ports:
     - '80:80'
     - '443:443'
    environment:
      DOMAINS: 'test.domain.in -> 10.20.3.1:8111'
      STAGE: 'staging' # Don't use production until staging works
      WEBSOCKET: 'true'
    volumes:
      - https-portal-data:/var/lib/https-portal

volumes:
    https-portal-data: {}# Recommended, to avoid re-signing when upgrading HTTPS-PORTAL

Additional Container:

version: '3'

services:
  https-portal:
    image: steveltn/https-portal:1
    ports:
     - '9080:80'
     - '9443:443'
    environment:
      DOMAINS: 'test.domain.in -> 10.20.3.1:8222'
      STAGE: 'staging' # Don't use production until staging works
      WEBSOCKET: 'true'
    volumes:
      - https-portal-data:/var/lib/https-portal

volumes:
    https-portal-data: {}# Recommended, to avoid re-signing when upgrading HTTPS-PORTAL

is this ok, or we will face any issues in the future while updating the certs, etc?

oscarmoraog commented 8 months ago

Hey, where you able to solve this issue? I'm facing the same and didn't realize how to use https-portal for several containers, even using reverse-proxy it's failing.

Any hint? Thanks in advance.

SteveLTN commented 8 months ago

Can we add more containers in the same host, something like modifying the ports (9443 instead of 443, 9080 instead of 80)

No. Let's Encrypt (where we get the HTTPS certificate from demands the port to be 80 and 443). But you can use two different domains, both listening on 80 and 443. For example:

    environment:
      DOMAINS: 'test.domain.in -> 10.20.3.1:8222, test2.domain.in -> 10.20.1.2:8333'
oscarmoraog commented 8 months ago

Nice, I tried to run an isolated https-portal per docker-compose file, now I've deployed a separated container only for ssl + reverse proxy for all my apps and worked pefectly. I guess it was the expected way to use but wasn't very clear for me.

So many thanks.