Docker Community Forums

Share and learn in the Docker community.

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 ?

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).

Set up your initial environment
Have an Azure account with an active subscription. Create an account for free.
Install Docker, which you use to build Docker images. Installing Docker may require a computer restart.
Install the Azure CLI 2.0.80 or higher, with which you run commands in any shell to provision and configure Azure resources.

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