Uptime Kuma
Uptime Kuma - Overview
Uptime Kuma is a powerful open-source tool for monitoring the availability and performance of your websites and services. With Uptime Kuma, you can easily track the uptime and response times of various endpoints. It provides a user-friendly web interface to view and analyze monitoring data.
This Docker Compose file sets up the Uptime Kuma service using the specified Docker image. It ensures that the service restarts automatically in case of failures. Port 3010 on the host is mapped to port 3001 inside the container, allowing you to access the Uptime Kuma web interface.
The use of Docker volumes ensures that data and configuration for Uptime Kuma are stored persistently, even if the container is recreated or updated. Additionally, mounting the Docker socket from the host into the container enables Uptime Kuma to monitor other Docker containers running on the same host, providing comprehensive monitoring capabilities.
Docker Compose
version: '3'
services:
uptime-kuma:
image: louislam/uptime-kuma:1
container_name: uptime-kuma
restart: always
ports:
- "3010:3001"
volumes:
- uptime-kuma:/app/data
- /var/run/docker.sock:/var/run/docker.sock
volumes:
uptime-kuma:
- Image: This specifies the Docker image to use for the Uptime Kuma service. In this case, it uses the "louislam/uptime-kuma" image with version 1.
- Container Name: Sets the name of the Docker container to "uptime-kuma." This is useful for referencing and managing the container.
- Restart: The "always" option means that the container will automatically restart if it stops or encounters an issue.
- Ports: Maps port 3010 on the host to port 3001 inside the container. This allows you to access the Uptime Kuma web interface from your host machine.
- Volumes:
- uptime-kuma:/app/data
: Creates a Docker volume named "uptime-kuma" and mounts it to the "/app/data" directory inside the container. This is used to persist Uptime Kuma's data and configuration, ensuring that data is not lost when the container is recreated or updated.- /var/run/docker.sock:/var/run/docker.sock
: This mounts the Docker socket from the host into the container. It allows Uptime Kuma to monitor other Docker containers on the host and gather information about their status.
Volumes:
- Defines a Docker volume named "uptime-kuma." This section is used to specify volume configurations and settings, but in this case, it's a simple declaration of the volume's name.
Deploying the Compose
docker-compose up -d
You can run this command in the directory where your Docker Compose file (containing the Uptime Kuma service definition) is located. It will start the Uptime Kuma service as a detached background process, allowing you to continue using your terminal for other tasks without the need to keep the container's output visible.
Make sure you have Docker and Docker Compose installed on your system before running this command.
No Comments