The second option is to use Nginx, we already set it up inside the docker container, so you don't have to worry about Configuring it. You just need to follow the steps below:
1- Adding certificate and key
In order to create a secure connection with the user’s browser, we’ll need to obtain a digital certificate and a private key. Normally, you get the certificate from a certificate authority such as Let’s Encrypt. Make sure to install the certificate using Certbot, which will take care of reconfiguring NGINX for you.
For local development you can also create a self-signed certificate. The only problem is that browsers will show a warning that the “Certificate is not Trusted” when someone visits your website. But for testing on your local machine that’s perfectly fine.
As you can see in your project root directory, we have two main directories, nginx and server. Once you have your certificate and private key, you need to add them to nginx directory with the following names:
cert.pem for the certificate
key.pem for the private key
2- Building docker-compose
Once you have your private key and ssl certificate in nginx directory, all you need is to build the docker-compose