# HTTPS docker compose with ssl certificate

**URL:** <https://forums.docker.com/t/https-docker-compose-with-ssl-certificate/93292>\
**Category:** General\
**Tags:** docker\
**Created:** [April 30, 2020, 2:33am UTC](https://forums.docker.com/t/https-docker-compose-with-ssl-certificate/93292 "2020-04-30T02:33:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pabgeo](https://avatars.discourse-cdn.com/v4/letter/p/59ef9b/32.png) [@pabgeo](https://forums.docker.com/u/pabgeo)\
**Post date:** [April 30, 2020, 2:33am UTC](https://forums.docker.com/t/https-docker-compose-with-ssl-certificate/93292/1 "2020-04-30T02:33:44Z")

</div>

![image](https://global.discourse-cdn.com/docker/original/3X/b/c/bc0ede76839efe26fb95a58ae3b9db04ac581c7f.png)

hello everyone in advance thanks for helping me those who have knowledge about my problem.

I want to display my application that is developed in php and apache, inside a docker compose container.

but since I am new to docker I cannot do it so that in the server it makes the requests by https and not by port 8080, I have read some tutorials without success, I hope you can help me guiding me, I attach the image of my two configuration files

---

<div class="post-metadata">

**Author:** ![derteufelqwe](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/derteufelqwe/32/29588_2.png) [@derteufelqwe](https://forums.docker.com/u/derteufelqwe)\
**Post date:** [April 30, 2020, 9:34am UTC](https://forums.docker.com/t/https-docker-compose-with-ssl-certificate/93292/2 "2020-04-30T09:34:00Z")

</div>

In your “ports” section you map your hosts ports to the ports in the container.  
Rightnow you map your port 8080 to the containers port 80 and your port 8081 to the containers port 443.  
The default port of HTTPS is 443, so all you need to change is the mapping “8081:443” to “443:443”  
While you’re at it you can also change the first port mapping to map your port 80 to the containers port 80. This will make your container also work with HTTP.

---

<div class="post-metadata">

**Author:** ![pabgeo](https://avatars.discourse-cdn.com/v4/letter/p/59ef9b/32.png) [@pabgeo](https://forums.docker.com/u/pabgeo)\
**Post date:** [May 7, 2020, 7:02pm UTC](https://forums.docker.com/t/https-docker-compose-with-ssl-certificate/93292/3 "2020-05-07T19:02:39Z")

</div>

hello I tried that way but when calling https: // … this does not resolve and no connection server comes out
