MikroTik Hotspot Monitor V3 by laksa19 inside container.
10K+
MikroTik Hotspot Monitor V3 by laksa19 inside container.
This image is using latest alpine for the base with PHP 7.4 FPM as the runtime. The exposed port is 8080/tcp and the default volume is pointed at /var/www/mikhmon which is the source code located inside container. Nginx and PHP-FPM are managed by supervisord inside the container. Hopefully, this will comply with any container orchestration platform like Kubernetes for the best practice of scaling and high availability.
Use any container tool such as docker or podman with simple command.
docker pull trianwar/mikhmon
docker run --name mikhmon-app -d -p 8080:8080 -v ./mikhmon-data:/var/www/mikhmon trianwar/mikhmon
If you want to access source code files inside the container storage, check the mounted volume on host at mikhmon-data. You can backup or modify those files.
To force stop and remove container.
docker rm --force --volumes mikhmon-app
The YAML files contain object definitions of Kubernetes resources (namespace, deployments, services, ingress, and persistent volume claims). Tested on GKE (Google Kubernetes Engine).
First, apply the namespace and persistent volume claims:
cd mikhmon-container/k8s-manifests
kubectl apply -f namespace.yml
kubectl apply -f pvc.yml
Then, apply the deployment, service, and ingress:
kubectl apply -f deployments.yml
kubectl apply -f services.yml
kubectl apply -f ingress.yml
Scale the application manually with --replicas option. Adjust the N number.
kubectl scale deployments mikhmon-app -n mikhmon-app --replicas=N
Check the deployment status:
kubectl get deployments -n mikhmon-app
kubectl get pods -n mikhmon-app
Delete the resources from cluster:
kubectl delete -f ingress.yml
kubectl delete -f services.yml
kubectl delete -f deployments.yml
kubectl delete -f pvc.yml
kubectl delete -f namespace.yml
Enter the docker-compose directory. The application uses a pre-built image trianwar/mikhmon:latest with Caddy as a reverse proxy to handle SSL termination automatically via Let's Encrypt. Environment variable MODE=caddy will disable nginx and only run php-fpm that will be use with caddy.
Update the domain name in Caddyfile to match your server's FQDN, and optionally add it to /etc/hosts for local testing:
echo '108.136.227.206 mikhmon.deployer.dpdns.org' | sudo tee -a /etc/hosts
Then, create the network and start the services:
cd mikhmon-container/docker-compose
docker network create net1 --driver bridge
docker compose -p mikhmon up -d
docker compose ls
docker ps

As you can see the MikroTik Router is added successfully to MIKHMON, and we got one year valid SSL from Let's Encrypt.
To stop the services:
docker compose -p mikhmon down
Feel free to modify and build the Dockerfile to fit with your needs. Make sure to have nginx.conf and supervisord.conf in the same directory.
docker build --no-cache -t trianwar/mikhmon:latest .
You can also tag it with a version:
docker build --no-cache -t trianwar/mikhmon:v1.0 .
/var/www/mikhmon container directory.nginx.conf and supervisord.conf files must be present in the root directory when building the Docker image.Caddyfile to your actual server's FQDN.Content type
Image
Digest
sha256:c591c1256…
Size
49.1 MB
Last updated
10 months ago
docker pull trianwar/mikhmon