Skip to content

Commit

Permalink
Document how the metrics app is deployed
Browse files Browse the repository at this point in the history
  • Loading branch information
ghickman committed Nov 9, 2023
1 parent f0b076b commit e85d639
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Metrics deployment instructions
## Create app
```bash
dokku$ dokku apps:create metrics
dokku$ dokku git:set metrics deploy-branch main
```

## Configure app
```bash
dokku config:set metrics GITHUB_TOKEN'xxx'
dokku config:set metrics SLACK_SIGNING_SECRET='xxx'
dokku config:set metrics SLACK_TECH_SUPPORT_CHANNEL_ID='xxx'
dokku config:set metrics SLACK_TOKEN='xxx'
dokku config:set metrics TIMESCALEDB_URL='xxx'
```

## Disable checks
Dokku performs health checks on apps during deploy by sending requests to port 80.
This tool isn't a web app does it can't accept requests on a port.
Disable the checks so deploys can happen.
```bash
dokku$ dokku checks:disable metrics
```

## Set up storage
This is only needed for backfills which make use of a SQLite db cache.
```bash
# the metrics container runs as uid 1000 (metrics)
# the other dokku containers on dokku3 run as uid 1013 (dokku)
# let's tell the container to run as 1013, then we can use the same file permissions
dokku$ dokku docker-options:add grafana deploy "--user 1013"
dokku$ dokku docker-options:add grafana run "--user 1013"

dokku$ dokku storage:ensure-directory metrics
dokku$ sudo chown -R dokku:dokku /var/lib/dokku/data/storage/metrics/
dokku$ dokku storage:mount metrics /var/lib/dokku/data/storage/metrics/:/storage
```

## Manually pushing
```bash
local$ git clone [email protected]:ebmdatalab/metrics.git
local$ cd metrics
local$ git remote add dokku dokku@MYSERVER:metrics
local$ git push dokku main
```

## Ensure persistent logs
```bash
dokku$ sudo mkdir -p /var/log/journal
```

0 comments on commit e85d639

Please sign in to comment.