Show / Hide Table of Contents
Edit on GitHub

Enabling SSL on Docker Swarm - Amplia

Stop the stack (if already running):

docker stack rm amplia

Store the certificate and key files as secrets (replace amplia.pem and amplia.key below with your certificate and key files):

docker secret create amplia_ssl_cert amplia.pem
docker secret create amplia_ssl_cert_key amplia.key

Edit the Docker compose file:

nano amplia-stack.yml

Uncomment the following entries:

...

secrets:
  ...
  # Uncomment to enable SSL
  amplia_ssl_cert:
    external: true
  amplia_ssl_cert_key:
    external: true

...

services:

  ...

  nginx:
    ...
    # Uncomment to enable SSL
    secrets:
      - amplia_ssl_cert
      - amplia_ssl_cert_key
    ports:
      - "80:80"
      # Uncomment to enable SSL
      - "443:443"

...

Edit the Nginx configuration file:

nano amplia-proxy.conf

Uncomment the following entries:

...

    # Uncomment to enable SSL
    listen               443 ssl;
    ssl_certificate      /run/secrets/amplia_ssl_cert;
    ssl_certificate_key  /run/secrets/amplia_ssl_cert_key;

...

Edit the Amplia configuration file:

nano amplia.json

Make the following changes:

  • Section Bindings
    • HttpsMode: change to RedirectPages to redirect to HTTPS users accessing the dashboard on HTTP
  • Section General
    • SiteUrl: change the protocol of the URL to https, e.g. https://ca.patorum.com

Deploy the stack with the new configurations:

docker stack deploy -c amplia-stack.yml amplia

See also

  • Installing Amplia on Docker Swarm
  • Using an external database
  • Checking the system logs
  • Persistent data (backup considerations)
  • Using a stack with GrantID
Back to top Copyright © 2015-2020 Lacuna Software