Docker Community Forums

Share and learn in the Docker community.

How to add https certification for one service using docker-compose.yaml file?

Hello All,

I want to add HTTPS certification for one service using docker-compose.yaml file.
Is it possible to add into docker-compose.yaml?

if possible to do it please suggest way to do it.
Note: I am using docker-compose file version - 3

Thanks in advance

With plaIn Docker-Compose you will need to use volume fort that. You can either mount a host folder or specific file into the container.

With Swarm deployments “secrets” are the prefered way.

Other option is user an Proxy/APIGateway that handle the SSL request like Traefik.
Traefik can user auto-generated LetsEncrypt’s Certificates or like Meyay says, use an external cert with a docker volume.