Setting up ssl/tls for docker

Thanks @bricks for describing this!
Much neater solution than using another container.
I’d like to add the possibility of using an override file, instead of editing the provided yml.
Create a file called docker-compose.override.yml next to the provided docker-compose.yml, including just the additions:

services:
  gsa:
    environment:
      - GSAD_ARGS=--no-redirect
    ports:
      - 443:443
    secrets:
      - source: server-certificate
        target: /var/lib/gvm/CA/servercert.pem
      - source: private-key
        target: /var/lib/gvm/private/CA/serverkey.pem

secrets:
  server-certificate:
    file: /opt/gvm/server.crt
  private-key:
    file: /opt/gvm/server.key
[root@server gvm]# ls -alh /opt/gvm/
-rw-r--r--. 1 root root  409 Apr 12 00:17 docker-compose.override.yml
-rw-r--r--. 1 root root 4.2K Apr 11 23:24 docker-compose.yml
-rw-r--r--. 1 root root   25 Apr 11 23:27 .env
-rw-r--r--. 1 root root 7.4K Apr 12 00:05 server.crt
-rw-r--r--. 1 root root 1.9K Apr 12 00:03 server.csr
-rw-r--r--. 1 root root 3.2K Apr 12 00:03 server.key

Compose will merge the files and run the combined settings, but the provided compose file is left untouched. :slight_smile:

3 Likes