How to run my container base application with HTTPS

I have one container base application which is accessing by http:\localhost:1414.

I want to access this with https:\localhost:1414

What are the steps do I need to follow for this ?

satara,
Typically, this is not how you would set this up. Applications generally to not support the HTTPS protocol. Usually, you would use a webserver like nginx or apache to proxy to the application and handle the HTTPS part. In docker, you would have a container for your application exposed on a port and then another container for the webserver exposed on a port. You would use a docker-compose file to link these 2 applications together on its own private network and determine what port(s) is/are actually exposed to the host. Without knowing more specifics, I recommend googling keywords like docker, your application and possibly https or production to find a really good walkthrough or tutorial you can follow. Hopefully, this gives you enough background to know what to search for.

I think it might help to have a good example. For example, I do a lot of work with django web applications. Here is a really good walkthrough tutorial for how to containerize my Django database application once I have it completed. It does not talk about https here but you can see the different containers and how they work together (nginx->application->database).

You can use Traefik v2 that will automate anything, or just nginx configured to use a static auto generated certificate.

Well, you will need a server like NGINX or Apache to setup to listen request on HTTPS.

1 Like