Getting this error: Failed to load TLS key

I’m running dragonfly via a docker container and I’m trying to get TLS working.
when i run docker compose up I get this error:
Failed to load TLS key
heres my docker-compose.yaml file

version: '3.8'

services:
  dragonfly:
    image: 'docker.dragonflydb.io/dragonflydb/dragonfly:latest'
    ports:
      - "6379:6379"
    command:
      - '--tls'
      - '--tls_key_file=/path/to/key.key'
      - '--tls_cert_file=/path/to/cert.pem'
      - '--requirepass=admin'
    volumes:
      - /path/to/cert/folder:/etc/letsencrypt/live/yourdomain.com

when running cat /path/to/cert.pem and cat /path/to/key.key it both runs fine displaying the information.
my key file does start with
-----BEGIN PRIVATE KEY-----
and ends with
-----END PRIVATE KEY-----

I cant seem to figure out what could be the issue.

sidenote: when I run it via the bin file it works fine
sudo ../dragonfly --tls --tls_key_file=/path/to/key.key --tls_cert_file=/path/to/cert.cer --tls_ca_cert_file=/path/to/cert.pem --requirepass=admin

although i do get some issues regarding “mixed-content” errors with the js and css being recieved over http instead of https

hi, highly likely you propagated the directory with symlinks into the container, not the files themselves, pls check
are you running cat /path/to/cert.pem inside the container to check the certs presence?

1 Like