Skip to content

Instantly share code, notes, and snippets.

@KidkArolis
Last active December 13, 2018 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KidkArolis/1d5be1e8cab76f1c5bb9bd13f43f5959 to your computer and use it in GitHub Desktop.
Save KidkArolis/1d5be1e8cab76f1c5bb9bd13f43f5959 to your computer and use it in GitHub Desktop.
Countly on DigitalOcean

To run this on DigitalOcean.

  1. Create a Droplet with Docker:

https://www.digitalocean.com/products/one-click-apps/docker/

  1. Place these files somewhere on the disk and run
docker-compose up -d
  1. See logs with
docker-compose logs -f
  1. Proxy to the service via nginx by creating /etc/nginx/sites-enabled/countly
server {
    listen 80;
    server_name countly.your.domain;

    location / {
        proxy_pass http://localhost:32768;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}
  1. Restart nginx
nginx -s reload
  1. Setup https using letsencrypt certbot

https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx

version: '3.4'
services:
countly:
restart: unless-stopped
build: .
volumes:
- countly-data:/var/lib/mongodb
ports:
- '32768:80'
volumes:
countly-data:
external: true
FROM countly/countly-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment