Published: Jan 25, 2024 by Isaac Johnson
Dokemon is a very similar tool to Portainer. It can both monitor and launch containerized services. It has a few other nifty features as well we can explore like variables, secrets and managed docker compose.
Firefly III is an Open-Source financial app that is somewhat similar to Quicken. We’ll actually use Dokemon to launch Firefly into our Docker host.
Dokemon
Dokemon is more than a simple Doker monitor. It can deploy compose files, delete images, view logs and start/stop containers.
Let’s start by firing it up in our Dockerhost.
I’ll first create a volume for it’s data
builder@builder-T100:~$ docker volume create dokemondata
dokemondata
Then fire it up on port 9090
builder@builder-T100:~$ sudo docker run -p 9090:9090 -v dokemondata:/data -v /var/run/docker.sock:/var/run/docker.sock --restart unless-stopped --name dokemon -d productiveops/dokemon:latest
Unable to find image 'productiveops/dokemon:latest' locally
latest: Pulling from productiveops/dokemon
07a64a71e011: Pull complete
fe5ca62666f0: Pull complete
280126c0e181: Pull complete
fcb6f6d2c998: Pull complete
e8c73c638ae9: Pull complete
1e3d9b7d1452: Pull complete
4aa0ea1413d3: Pull complete
7c881f9ab25e: Pull complete
5627a970d25e: Pull complete
19cf2287de7f: Pull complete
ebba9ccde3ef: Pull complete
1933f300df8c: Pull complete
f963c7828c33: Pull complete
3ad3db87a08a: Pull complete
0cea5799cc0f: Pull complete
934601d3ba5c: Pull complete
Digest: sha256:355d6cec1acc7fc07b9b16acc395a9945054d2f1c26cadffab828a515370da78
Status: Downloaded newer image for productiveops/dokemon:latest
b1ca143ab3500f9862777cec28cf88fe433877aaa7647de1f150d356f63f1374
The first step is to create a user
and I’m now greeted by my Server Dashboard
At first, the UI for containers threw me - as it shows “red” for “new image available”. I usually associate red with stopped
The Terminal section provides a nice lightweight terminal to your container
And the logs let you view and download logs to a file
It’s pretty easy to identify unused containers and remove them:
We can also identify unused volumes for cleanup
Images will show us images and if they are in use, but sadly it doesn’t let us sort the columns. That would be my first feature request - let me find the largest images that are unused to remove
Lastly, Networks show us Networks and their status
Docker Compose
The other big feature of Dokemon is the ability to launch things with Docker compose
Saw we wnted to fire up Portainer. We could use this repo in Github
We can add it to compose by clicking save
Then Deploy it (Pull+Up) it
Here you can see it come up, us use it, then tear it down
Externalizing with K8s
Let’s create a quick A Record
$ cat ./r53-dokemon.json
{
"Comment": "CREATE dokemon fb.s A record ",
"Changes": [
{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": "dokemon.freshbrewed.science",
"Type": "A",
"TTL": 300,
"ResourceRecords": [
{
"Value": "75.73.224.240"
}
]
}
}
]
}
$ aws route53 change-resource-record-sets --hosted-zone-id Z39E8QFU0F9PZP --change-batch file://r53-dokemon.json
{
"ChangeInfo": {
"Id": "/change/C0287216174YONGUZJUIL",
"Status": "PENDING",
"SubmittedAt": "2024-01-04T00:10:55.239Z",
"Comment": "CREATE dokemon fb.s A record "
}
}
I can now use a quick YAML to create an external endpoint, service and ingress to forward traffic
$ cat ingress.dokemon.yaml
---
apiVersion: v1
kind: Endpoints
metadata:
name: dokemon-external-ip
subsets:
- addresses:
- ip: 192.168.1.100
ports:
- name: dokemon
port: 9090
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: dokemon-external-ip
spec:
clusterIP: None
clusterIPs:
- None
internalTrafficPolicy: Cluster
ipFamilies:
- IPv4
- IPv6
ipFamilyPolicy: RequireDualStack
ports:
- name: dokemon
port: 80
protocol: TCP
targetPort: 9090
sessionAffinity: None
type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
nginx.org/websocket-services: dokemon-external-ip
generation: 1
labels:
app.kubernetes.io/instance: dokemoningress
name: dokemoningress
spec:
rules:
- host: dokemon.freshbrewed.science
http:
paths:
- backend:
service:
name: dokemon-external-ip
port:
number: 80
path: /
pathType: ImplementationSpecific
tls:
- hosts:
- dokemon.freshbrewed.science
secretName: dokemon-tls
$ kubectl apply -f ingress.dokemon.yaml
endpoints/dokemon-external-ip created
service/dokemon-external-ip created
ingress.networking.k8s.io/dokemoningress created
Since this app has a password, I feel a bit more safe with it.
I can now login remotely and view/manage the containers on my Docker host
Firefly 3
Let’s pivot to a Financial OS app, Firefly
Two things I need to setup first; a database and a docker volume
I can actually use my VS Code remote web’s terminal to shell over to the Dockerhost to make the volume
I’ll also create a database and user in a local psql host
postgres@isaac-MacBookAir:~$ createuser --pwprompt firefly
Enter password for new role:
Enter it again:
postgres@isaac-MacBookAir:~$ createdb firefly
postgres@isaac-MacBookAir:~$ psql
psql (12.17 (Ubuntu 12.17-0ubuntu0.20.04.1))
Type "help" for help.
postgres=# grant all privileges on database firefly to firefly;
GRANT
postgres=# GRANT ALL ON ALL TABLES IN SCHEMA public TO firefly;
GRANT
Back in Dokemon, I need to create an env (neccessary to create secrets and configs)
version: '3'
services:
firefly:
image: fireflyiii/core:latest
ports:
- 9098:8080
volumes:
- firefly_iii_upload:/var/www/html/storage/upload
environment:
- APP_KEY=Yjg4ZmMwMzEtZjYxZS00ZjQwLWE3YjAtZjU0MjQyYzEwYjQ2
- DB_HOST=$fireflydb
- DB_PORT=5432
- DB_CONNECTION=pgsql
- DB_DATABASE=firefly
- DB_USERNAME=$fireflyuser
- DB_PASSWORD=$fireflypass
volumes:
firefly_iii_upload:
I’ll now add to my library
Then “Add from Library” to create an instantiation in the host
Once added, I can do a docker up
This fired it up
According to the page now, it’s running
The logs would suggest my key length is wrong
I tore it down down “Down”
Then fixed the issue and launched it again
I realized I needed to set my main node to an “environment”
Once set, when I did the “up”, i could see it pulled in the vars
Once I figured out the API Key format and length, it came up
Let’s create some fake numbers
It then will take us through a tour of features
We can add Transactions manually
If you want to import your transactions from a bank, you can use the Firefly 3 Data Importer. It’s kept seperate for security reasons and uses gocardless and SaltEdge.
SaltEdge can also connect to things like PayPal
We can export our transactions as a CSV file
We can add bills as well as regular recurring experiences