Security

Enabling an SSL Layer on top of Docker Containers

Enabling an SSL Layer on top of Docker Container increases the container security by encrypting traffic from the container all the way to the application.

To use it you should have an SSL certificate. You can use CA Signed Certificate or self-signed certificate.

To enable SSL on top of Docker container next Environment variable should be added to the deployment:

ENABLE_SSL=true
SSL_KEY="-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAs72aa5FKcRmLMJnVx/4AWI1PNcvJOMAAbSc/NXJAt5Gs9QZI\nw0I..."
SSL_CERT="-----BEGIN CERTIFICATE-----\nMIIDcTCCAlkCFHox4bsG4jGVtB9WvObnL8LnToGeMA0GCSqGSIb3DQEBCwUAMHUx\nCzAJ..."

Please, pay attention, that for setting SSL_KEY and SSL_CERT:

  • new string in corresponding file should be set to '\n'

  • double quotes should be used