Traefik is a "modern HTTP reverse proxy and load balancer that makes deploying microservices easy." Among other things, Traefik can automatically discover applications like ActivityInfo that you have deployed with Docker, and automatically configure routing and an SSL certificate.
Digital Ocean provides a complete guide to deploying and starting Traefik on Ubuntu 20.04. Follow the instructions in this article if you do not yet have Traefik running.
The following Docker Compose file configures the ActivityInfo server. Save the following configuration to a file named
version: "3" networks: web: external: true services: activityinfo: image: activityinfo/activityinfo:4.1.3 volumes: - activityinfo:/data labels: - traefik.http.routers.activityinfo.rule=Host(`activityinfo.example.gov`) && Path(`/resources/ping`) - traefik.http.routers.activityinfo.tls=true - traefik.http.routers.activityinfo.tls.certresolver=lets-encrypt - traefik.port=80 environment: - ACTIVITYINFO_SERVER_HTTPS_PROXY=TRUE - ACTIVITYINFO_SERVER_DOMAIN=activityinfo.example.gov networks: - web volumes: activityinfo:
To start the service, change to the directory in which the Docker compose file is located and run:
docker-compose up -d