CLI for Dockge using Python
Find a file
Firq 09da354b0e
All checks were successful
/ pylint (push) Successful in 12s
/ mypy (push) Successful in 14s
/ lint-and-typing (push) Successful in 17s
/ build-artifacts (push) Successful in 8s
/ publish-artifacts (push) Successful in 9s
/ build-and-push-container (push) Successful in 1m15s
/ release (push) Successful in 40s
Fixed workflow 2
2024-07-22 17:47:06 +02:00
.forgejo/workflows Fixed workflow 2 2024-07-22 17:47:06 +02:00
dockge_cli More logging 2024-07-20 17:49:25 +02:00
.gitignore Improved typing, refactored code, fixed some issues 2024-07-04 22:12:36 +02:00
Dockerfile Add docker build step to provide ready-to-use dockge cli container 2024-07-22 17:40:57 +02:00
pyproject.toml Fixed version 2024-07-22 17:42:48 +02:00
README.md Added better uri parsing, updated README 2024-07-09 14:34:07 +02:00

dockge-cli

A simple CLI application written in Python for communicating with Dockge using websockets

Background

Dockge (spoken dock-ge or dockage) is a tool to manage docker-compose stacks from a web ui. It is developed by louislam, who also develops UptimeKuma.

Dockge itself doesn't offer any kind of API or programmatic access, as it is just intended for managing stacks via UI.

My current deployment solution for firq.dev and fgo-ta.com is based on Dockge, and I was over it always having to reload the stack whenever I pushed an update. Instead, I wanted to have this as a separate CI step, automatically redeploying a givens stack.

As Dockge is using a websocket-based system under the hood, it was easy to take a look at how communication occurs. In general, communication is achieved by leveraging socket.io for the data. Since Python already offers a solution for socket.io, it is just a matter of emulating the calls the webui sends and receives.

In the end, this is the current result that works pretty well for my understanding. I am still trying to improve upon some issues (login times out, stability, features), but in general this works as a fine solution for automatic stack updating.

Installation

Install it from the custom package index using

pip install --extra-index-url https://forgejo.neshweb.net/api/packages/Firq/pypi/simple/ dockge-cli

Alternativly, install it using this repository. When installing for development, make sure to install with the additional dependencies

pip install -e .[lint,typing]

Usage

Call the CLI using dockge-cli or dockge.