Custom TLS Certificate

To replace the self-signed certificate cert.crt with the key cert.key with your own, you need to mount the certificate and key:

  1. Create a YML file named docker-compose.cert.yml with the following content:

    services:
      nginx:
        volumes:
        - ./example.com.crt:/etc/nginx/cert.crt:ro
        - ./example.com.key:/etc/nginx/cert.key:ro
  2. Add docker-compose.cert.yml to the COMPOSE_FILE list in the .env file:

    sed -i 's/^COMPOSE_FILE=\(.*\)$/COMPOSE_FILE=\1:docker-compose.cert.yml/' .env
  3. Restart the Nginx service:

    docker-compose rm -s nginx && docker-compose up -d nginx