Compare commits

..

5 Commits

Author SHA1 Message Date
4d8b5c39e5 docker stats nightmare
All checks were successful
Rust Cross-Platform Build / Detect Rust Project (push) Successful in 5s
Rust Cross-Platform Build / Run Tests (push) Successful in 1m17s
Rust Cross-Platform Build / Build (x86_64-unknown-linux-gnu) (push) Successful in 3m30s
Rust Cross-Platform Build / Build (x86_64-pc-windows-gnu) (push) Successful in 4m22s
Rust Cross-Platform Build / Set Tag Name (push) Successful in 4s
Rust Cross-Platform Build / Build and Push Docker Image (push) Successful in 2m24s
Rust Cross-Platform Build / Workflow Summary (push) Successful in 2s
Rust Cross-Platform Build / Create Tag (push) Successful in 5s
2025-10-30 13:33:47 +01:00
4e28d57460 added documentation to /docker/stats mod.rs 2025-10-30 09:57:24 +01:00
6405ab16e4 added documentation to /docker mod.rs 2025-10-30 09:52:08 +01:00
c165ee9cc2 renamed docker detect dto
All checks were successful
Rust Cross-Platform Build / Detect Rust Project (push) Successful in 4s
Rust Cross-Platform Build / Run Tests (push) Successful in 1m6s
Rust Cross-Platform Build / Build (x86_64-unknown-linux-gnu) (push) Successful in 2m53s
Rust Cross-Platform Build / Build (x86_64-pc-windows-gnu) (push) Successful in 3m41s
Rust Cross-Platform Build / Set Tag Name (push) Successful in 3s
Rust Cross-Platform Build / Build and Push Docker Image (push) Successful in 2m5s
Rust Cross-Platform Build / Workflow Summary (push) Successful in 2s
Rust Cross-Platform Build / Create Tag (push) Successful in 5s
2025-10-29 23:07:34 +01:00
7d6b5165c1 changed noting
All checks were successful
Rust Cross-Platform Build / Detect Rust Project (push) Successful in 5s
Rust Cross-Platform Build / Run Tests (push) Successful in 1m12s
Rust Cross-Platform Build / Build (x86_64-unknown-linux-gnu) (push) Successful in 3m3s
Rust Cross-Platform Build / Build (x86_64-pc-windows-gnu) (push) Successful in 3m57s
Rust Cross-Platform Build / Set Tag Name (push) Successful in 4s
Rust Cross-Platform Build / Build and Push Docker Image (push) Successful in 2m15s
Rust Cross-Platform Build / Workflow Summary (push) Successful in 1s
Rust Cross-Platform Build / Create Tag (push) Successful in 4s
2025-10-29 22:45:39 +01:00
9 changed files with 246 additions and 54 deletions

View File

@@ -15,7 +15,7 @@ use std::time::Duration;
use crate::docker::serverclientcomm::handle_server_message; use crate::docker::serverclientcomm::handle_server_message;
use crate::hardware::HardwareInfo; use crate::hardware::HardwareInfo;
use crate::models::{ use crate::models::{
Acknowledgment, DockerMetricDto, DockerRegistrationDto, HeartbeatDto, Acknowledgment, DockerMetricDto, DockerServiceDto, HeartbeatDto,
IdResponse, MetricDto, RegistrationDto, ServerMessage, IdResponse, MetricDto, RegistrationDto, ServerMessage,
}; };
@@ -190,7 +190,7 @@ async fn get_server_id_by_ip(
pub async fn broadcast_docker_containers( pub async fn broadcast_docker_containers(
base_url: &str, base_url: &str,
server_id: u16, server_id: u16,
container_dto: &DockerRegistrationDto, container_dto: &DockerServiceDto,
) -> Result<(), Box<dyn Error + Send + Sync>> { ) -> Result<(), Box<dyn Error + Send + Sync>> {
// First get local IP // First get local IP
println!("Preparing to broadcast docker containers..."); println!("Preparing to broadcast docker containers...");
@@ -424,14 +424,37 @@ pub async fn send_acknowledgment(
Ok(()) Ok(())
} }
/// Sends Docker container metrics to the backend monitoring endpoint.
///
/// This function asynchronously transmits Docker container statistics including
/// CPU usage, memory consumption, network I/O, and container status to the
/// backend server for monitoring and analysis.
///
/// # Arguments
///
/// * `base_url` - The base URL of the backend server (e.g., "http://localhost:8080")
/// * `docker_metrics` - Reference to a [`DockerMetricDto`] containing container metrics data
///
/// # Returns
///
/// * `Ok(())` - If the HTTP request was successfully sent (regardless of HTTP status code)
/// * `Err(Box<dyn Error + Send + Sync>)` - If JSON serialization fails or other errors occur
///
/// # Behavior
///
/// - Constructs the full endpoint URL: `{base_url}/monitoring/docker-metric`
/// - Serializes the metrics data to pretty JSON for debugging output
/// - Sends a POST request with JSON content-type
/// - Logs success/failure messages to stdout/stderr
/// - Always returns `Ok(())` after request attempt (does not validate HTTP response status)
pub async fn send_docker_metrics( pub async fn send_docker_metrics(
base_url: &str, base_url: &str,
docker_metrics: &DockerMetricDto, docker_metrics: &DockerMetricDto,
) -> Result<(), Box<dyn Error + Send + Sync>> { ) -> Result<(), Box<dyn Error + Send + Sync>> {
let client = Client::new(); let client = Client::new();
let url = format!("{}/monitoring/docker-metric", base_url); let url = format!("{}/monitoring/docker-metric", base_url);
println!("Docker Metrics: {}", serde_json::to_string_pretty(&docker_metrics)?); println!("📤 JSON being posted:\n{}", serde_json::to_string_pretty(&docker_metrics)?);
match client.post(&url).json(&docker_metrics).send().await { match client.post(&url).json(&docker_metrics).send().await {
Ok(res) => println!( Ok(res) => println!(

View File

@@ -154,19 +154,6 @@ pub async fn restart_container(
Ok(()) Ok(())
} }
/*
/// Extracts a Docker container ID from a string line.
///
/// # Arguments
/// * `line` - The input string containing a container ID or related info.
///
/// # Returns
/// * `Option<String>` - The extracted container ID if found.
pub fn extract_client_container_id(line: &str) -> Option<String> {
// ...existing code...
}
*/
/// Gets network statistics for a specific container /// Gets network statistics for a specific container
pub async fn get_network_stats( pub async fn get_network_stats(
docker: &Docker, docker: &Docker,

View File

@@ -13,7 +13,7 @@ pub mod stats;
use crate::models::{ use crate::models::{
DockerCollectMetricDto, DockerContainer, DockerContainerCpuDto, DockerContainerInfo, DockerCollectMetricDto, DockerContainer, DockerContainerCpuDto, DockerContainerInfo,
DockerContainerNetworkDto, DockerContainerRamDto, DockerMetricDto, DockerRegistrationDto, DockerContainerNetworkDto, DockerContainerRamDto, DockerMetricDto, DockerServiceDto,
DockerContainerStatusDto DockerContainerStatusDto
}; };
use bollard::Docker; use bollard::Docker;
@@ -35,7 +35,15 @@ impl Default for DockerManager {
} }
impl DockerManager { impl DockerManager {
/// Creates a new DockerManager instance /// Creates a new DockerManager instance with Docker connection
///
/// Establishes a connection to the local Docker daemon using default connection settings.
/// This is the primary constructor for the Docker manager.
///
/// # Returns
///
/// * `Ok(Self)` - Successfully connected Docker manager instance
/// * `Err(Box<dyn Error + Send + Sync>)` - If Docker daemon is not running or connection fails
pub fn new() -> Result<Self, Box<dyn Error + Send + Sync>> { pub fn new() -> Result<Self, Box<dyn Error + Send + Sync>> {
let docker = Docker::connect_with_local_defaults() let docker = Docker::connect_with_local_defaults()
.map_err(|e| format!("Failed to connect to Docker: {}", e))?; .map_err(|e| format!("Failed to connect to Docker: {}", e))?;
@@ -44,13 +52,31 @@ impl DockerManager {
} }
/// Creates a DockerManager instance with optional Docker connection /// Creates a DockerManager instance with optional Docker connection
///
/// Attempts to connect to Docker but returns None instead of an error if connection fails.
/// Useful for scenarios where Docker availability is optional.
///
/// # Returns
///
/// * `Some(Self)` - If Docker connection is successful
/// * `None` - If Docker connection fails or Docker daemon is not available
pub fn new_optional() -> Option<Self> { pub fn new_optional() -> Option<Self> {
Docker::connect_with_local_defaults() Docker::connect_with_local_defaults()
.map(|docker| Self { docker }) .map(|docker| Self { docker })
.ok() .ok()
} }
/// Finds the Docker container running the agent by image name
/// Finds the Docker container running the WatcherAgent by image name
///
/// Searches through all available containers to find the one running the agent.
/// Matches containers whose image name contains "watcher-agent".
///
/// # Returns
///
/// * `Ok(Some(DockerContainer))` - Agent container found with full container details
/// * `Ok(None)` - No agent container found (agent may not be running in Docker)
/// * `Err(Box<dyn Error + Send + Sync>)` - If container enumeration fails
pub async fn get_client_container( pub async fn get_client_container(
&self, &self,
) -> Result<Option<DockerContainer>, Box<dyn Error + Send + Sync>> { ) -> Result<Option<DockerContainer>, Box<dyn Error + Send + Sync>> {
@@ -67,7 +93,14 @@ impl DockerManager {
})) }))
} }
/// Gets the current client version (image name) if running in Docker /// Gets the current client version from Docker image name
///
/// Extracts the image name (without tag) from the agent's container.
/// Returns "unknown" if the agent is not running in Docker or if version cannot be determined.
///
/// # Returns
///
/// * `String` - Image name portion before ':' tag, or "unknown" if not determinable
pub async fn get_client_version(&self) -> String { pub async fn get_client_version(&self) -> String {
match self.get_client_container().await { match self.get_client_container().await {
Ok(Some(container)) => container Ok(Some(container)) => container
@@ -90,6 +123,13 @@ impl DockerManager {
} }
/// Checks if Docker is available and the agent is running in a container /// Checks if Docker is available and the agent is running in a container
///
/// Determines whether the agent is operating within a Docker container environment.
/// This is used to enable/disable Docker-specific functionality.
///
/// # Returns
///
/// * `bool` - True if agent is running in Docker container, false otherwise
pub async fn is_dockerized(&self) -> bool { pub async fn is_dockerized(&self) -> bool {
self.get_client_container() self.get_client_container()
.await .await
@@ -97,7 +137,15 @@ impl DockerManager {
.unwrap_or(false) .unwrap_or(false)
} }
/// Gets all available containers as DTOs for registration /// Gets all available Docker containers as DTOs
///
/// Retrieves a list of all containers (running and stopped) and converts them
/// to simplified DTOs suitable for registration with the backend server.
///
/// # Returns
///
/// * `Ok(Vec<DockerContainer>)` - List of all containers with id, image, and name
/// * `Err(Box<dyn Error + Send + Sync>)` - If container enumeration fails
pub async fn get_containers( pub async fn get_containers(
&self, &self,
) -> Result<Vec<DockerContainer>, Box<dyn Error + Send + Sync>> { ) -> Result<Vec<DockerContainer>, Box<dyn Error + Send + Sync>> {
@@ -114,12 +162,32 @@ impl DockerManager {
} }
/// Gets the number of running containers /// Gets the number of running containers
///
/// Counts all containers that are currently available (both running and stopped).
/// This provides a quick overview of container density on the host.
///
/// # Returns
///
/// * `Ok(usize)` - Total number of containers
/// * `Err(Box<dyn Error + Send + Sync>)` - If container counting fails
pub async fn get_container_count(&self) -> Result<usize, Box<dyn Error + Send + Sync>> { pub async fn get_container_count(&self) -> Result<usize, Box<dyn Error + Send + Sync>> {
let containers = container::get_available_containers(&self.docker).await; let containers = container::get_available_containers(&self.docker).await;
Ok(containers.len()) Ok(containers.len())
} }
/// Restarts a specific container by ID /// Restarts a specific container by ID
///
/// Initiates a restart of the specified container. This is typically used
/// in response to backend commands for container management.
///
/// # Arguments
///
/// * `container_id` - The full or partial container ID to restart
///
/// # Returns
///
/// * `Ok(())` - Container restart successfully initiated
/// * `Err(Box<dyn Error + Send + Sync>)` - If container not found or restart fails
pub async fn restart_container( pub async fn restart_container(
&self, &self,
container_id: &str, container_id: &str,
@@ -127,7 +195,16 @@ impl DockerManager {
container::restart_container(&self.docker, container_id).await container::restart_container(&self.docker, container_id).await
} }
/// Collects Docker metrics for all containers /// Collects comprehensive Docker metrics for all containers
///
/// Gathers CPU usage, memory consumption, network I/O, and status information
/// for all containers. Matches statistics to containers using container ID prefixes.
/// Returns partial data even if some statistics collection fails.
///
/// # Returns
///
/// * `Ok(DockerMetricDto)` - Complete metrics data for all containers
/// * `Err(Box<dyn Error + Send + Sync>)` - If critical failures occur
pub async fn collect_metrics(&self) -> Result<DockerMetricDto, Box<dyn Error + Send + Sync>> { pub async fn collect_metrics(&self) -> Result<DockerMetricDto, Box<dyn Error + Send + Sync>> {
let containers = self.get_containers().await?; let containers = self.get_containers().await?;
@@ -303,14 +380,23 @@ impl DockerManager {
Ok(dto) Ok(dto)
} }
/// Creates registration DTO with container information
///
/// Prepares container data for initial registration with the backend server.
/// This includes basic container information without detailed metrics.
///
/// # Returns
///
/// * `Ok(DockerServiceDto)` - Container information ready for registration
/// * `Err(Box<dyn Error + Send + Sync>)` - If container enumeration fails
pub async fn create_registration_dto( pub async fn create_registration_dto(
&self, &self,
) -> Result<DockerRegistrationDto, Box<dyn Error + Send + Sync>> { ) -> Result<DockerServiceDto, Box<dyn Error + Send + Sync>> {
let containers = self.get_containers().await?; let containers = self.get_containers().await?;
let container_string = serde_json::to_value(&containers)?; let container_string = serde_json::to_value(&containers)?;
let dto = DockerRegistrationDto { let dto = DockerServiceDto {
server_id: 0, // This will be set by the caller server_id: 0, // This will be set by the caller
containers: container_string, containers: container_string,
}; };
@@ -322,16 +408,33 @@ impl DockerManager {
// Keep these as utility functions if needed, but they should use DockerManager internally // Keep these as utility functions if needed, but they should use DockerManager internally
impl DockerContainer { impl DockerContainer {
/// Returns the container ID /// Returns the container ID
///
/// # Returns
///
/// * `&str` - Full container ID string
pub fn id(&self) -> &str { pub fn id(&self) -> &str {
&self.id &self.id
} }
/// Returns the image name /// Returns the container image name
///
/// Returns "unknown" if the image name is not available.
///
/// # Returns
///
/// * `&str` - Image name or "unknown" if not available
pub fn image(&self) -> &str { pub fn image(&self) -> &str {
&self.image.as_deref().unwrap_or("unknown") &self.image.as_deref().unwrap_or("unknown")
} }
/// Returns the container name /// Returns the container name
///
/// Returns "unknown" if the container name is not available.
/// Container names typically start with '/' in Docker.
///
/// # Returns
///
/// * `&str` - Container name or "unknown" if not available
pub fn name(&self) -> &str { pub fn name(&self) -> &str {
&self.name.as_deref().unwrap_or("unknown") &self.name.as_deref().unwrap_or("unknown")
} }

View File

@@ -51,19 +51,19 @@ pub async fn get_single_container_cpu_stats(
if let (Some(cpu_usage), Some(pre_cpu_usage)) = if let (Some(cpu_usage), Some(pre_cpu_usage)) =
(&cpu_stats.cpu_usage, &precpu_stats.cpu_usage) (&cpu_stats.cpu_usage, &precpu_stats.cpu_usage)
{ {
let cpu_delta = cpu_usage let cpu_delta: f64 = cpu_usage
.total_usage .total_usage
.unwrap_or(0) .unwrap_or(0)
.saturating_sub(pre_cpu_usage.total_usage.unwrap_or(0)); .saturating_sub(pre_cpu_usage.total_usage.unwrap_or(0)) as f64;
let system_delta = cpu_stats let system_delta: f64 = cpu_stats
.system_cpu_usage .system_cpu_usage
.unwrap_or(0) .unwrap_or(0)
.saturating_sub(precpu_stats.system_cpu_usage.unwrap_or(0)); .saturating_sub(precpu_stats.system_cpu_usage.unwrap_or(0)) as f64;
let online_cpus = cpu_stats.online_cpus.unwrap_or(1); let online_cpus = cpu_stats.online_cpus.unwrap_or(1);
let cpu_percent = if system_delta > 0 && online_cpus > 0 { let cpu_percent = if system_delta > 0.0 && online_cpus > 0 {
(cpu_delta as f64 / system_delta as f64) * online_cpus as f64 * 100.0 (cpu_delta as f64 / system_delta as f64) * online_cpus as f64 * 100.0
} else { } else {
0.0 0.0

View File

@@ -46,6 +46,20 @@ use bollard::Docker;
use std::error::Error; use std::error::Error;
/// Get container statistics for all containers using an existing Docker client /// Get container statistics for all containers using an existing Docker client
///
/// Collects comprehensive statistics for all containers including CPU usage, network I/O,
/// memory consumption, and container status. This is the primary function for gathering
/// complete container metrics in a single operation.
///
/// # Arguments
///
/// * `docker` - Reference to connected Docker client
///
/// # Returns
///
/// * `Ok((Vec<ContainerCpuInfo>, Vec<ContainerNetworkInfo>, Vec<ContainerMemoryInfo>, Vec<ContainerStatusInfo>))` -
/// Tuple containing vectors of CPU, network, memory, and status information for all containers
/// * `Err(Box<dyn Error + Send + Sync>)` - If any statistics collection fails
pub async fn get_container_stats( pub async fn get_container_stats(
docker: &Docker, docker: &Docker,
) -> Result< ) -> Result<
@@ -66,6 +80,20 @@ pub async fn get_container_stats(
} }
/// Get container statistics for a specific container /// Get container statistics for a specific container
///
/// Retrieves detailed metrics for a single container identified by its ID.
/// Useful for targeted monitoring or when responding to container-specific commands.
///
/// # Arguments
///
/// * `docker` - Reference to connected Docker client
/// * `container_id` - The ID of the container to inspect
///
/// # Returns
///
/// * `Ok((Option<ContainerCpuInfo>, Option<ContainerNetworkInfo>, Option<ContainerMemoryInfo>, Option<ContainerStatusInfo>))` -
/// Tuple containing optional CPU, network, memory, and status information for the specified container
/// * `Err(Box<dyn Error + Send + Sync>)` - If statistics collection fails
pub async fn get_single_container_stats( pub async fn get_single_container_stats(
docker: &Docker, docker: &Docker,
container_id: &str, container_id: &str,
@@ -84,6 +112,18 @@ pub async fn get_single_container_stats(
} }
/// Get total network statistics across all containers /// Get total network statistics across all containers
///
/// Calculates the sum of network receive and transmit bytes across all containers.
/// This provides an overview of total network traffic generated by all containers.
///
/// # Arguments
///
/// * `docker` - Reference to connected Docker client
///
/// # Returns
///
/// * `Ok((u64, u64))` - Tuple containing total received bytes and total transmitted bytes
/// * `Err(Box<dyn Error + Send + Sync>)` - If network statistics collection fails
pub async fn get_total_network_stats( pub async fn get_total_network_stats(
docker: &Docker, docker: &Docker,
) -> Result<(u64, u64), Box<dyn Error + Send + Sync>> { ) -> Result<(u64, u64), Box<dyn Error + Send + Sync>> {
@@ -91,11 +131,35 @@ pub async fn get_total_network_stats(
} }
/// Get average CPU usage across all containers /// Get average CPU usage across all containers
///
/// Calculates the average CPU usage percentage across all running containers.
/// This provides a high-level overview of container CPU utilization.
///
/// # Arguments
///
/// * `docker` - Reference to connected Docker client
///
/// # Returns
///
/// * `Ok(f64)` - Average CPU usage percentage across all containers (0.0-100.0)
/// * `Err(Box<dyn Error + Send + Sync>)` - If CPU statistics collection fails
pub async fn get_average_cpu_usage(docker: &Docker) -> Result<f64, Box<dyn Error + Send + Sync>> { pub async fn get_average_cpu_usage(docker: &Docker) -> Result<f64, Box<dyn Error + Send + Sync>> {
cpu::get_average_cpu_usage(docker).await cpu::get_average_cpu_usage(docker).await
} }
/// Get total memory usage across all containers /// Get total memory usage across all containers
///
/// Calculates the sum of memory usage across all containers.
/// This provides an overview of total memory consumption by all containers.
///
/// # Arguments
///
/// * `docker` - Reference to connected Docker client
///
/// # Returns
///
/// * `Ok(u64)` - Total memory usage in bytes across all containers
/// * `Err(Box<dyn Error + Send + Sync>)` - If memory statistics collection fails
pub async fn get_total_memory_usage(docker: &Docker) -> Result<u64, Box<dyn Error + Send + Sync>> { pub async fn get_total_memory_usage(docker: &Docker) -> Result<u64, Box<dyn Error + Send + Sync>> {
ram::get_total_memory_usage(docker).await ram::get_total_memory_usage(docker).await
} }

View File

@@ -5,6 +5,22 @@ use bollard::query_parameters::{ListContainersOptions, InspectContainerOptions};
use bollard::models::{ContainerSummaryStateEnum, ContainerStateStatusEnum}; use bollard::models::{ContainerSummaryStateEnum, ContainerStateStatusEnum};
/// Get status information for all containers /// Get status information for all containers
///
/// # Arguments
///
/// * `docker` - Reference to Docker client
///
/// # Returns
///
/// * `Ok(Vec<ContainerStatusInfo>)` - Vector of container status information
/// * `Err(Box<dyn Error + Send + Sync>)` - If Docker API call fails
///
/// # Behavior
///
/// - Lists all containers (including stopped ones)
/// - Converts container state enum to string representation
/// - Converts timestamp from i64 to string
/// - Returns basic status info (finished_at is not available in list view)
pub async fn get_all_containers_status( pub async fn get_all_containers_status(
docker: &Docker, docker: &Docker,
) -> Result<Vec<ContainerStatusInfo>, Box<dyn Error + Send + Sync>> { ) -> Result<Vec<ContainerStatusInfo>, Box<dyn Error + Send + Sync>> {
@@ -52,7 +68,26 @@ pub async fn get_all_containers_status(
Ok(status_infos) Ok(status_infos)
} }
/// Get status information for a specific container /// Get status information for a specific container
///
/// # Arguments
///
/// * `docker` - Reference to Docker client
/// * `container_id` - ID of the container to inspect
///
/// # Returns
///
/// * `Ok(Some(ContainerStatusInfo))` - Status info if container found
/// * `Ok(None)` - If container not found
/// * `Err(Box<dyn Error + Send + Sync>)` - If Docker API call fails
///
/// # Behavior
///
/// - First tries to find container in list (faster)
/// - Falls back to container inspect for detailed info
/// - Provides more detailed information including finished_at timestamp
/// - Handles container not found case gracefully
pub async fn get_single_container_status( pub async fn get_single_container_status(
docker: &Docker, docker: &Docker,
container_id: &str, container_id: &str,

View File

@@ -115,7 +115,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
docker_manager.create_registration_dto().await? docker_manager.create_registration_dto().await?
} else { } else {
println!("Fallback for failing registration"); println!("Fallback for failing registration");
models::DockerRegistrationDto { models::DockerServiceDto {
server_id: 0, server_id: 0,
//container_count: 0, --- IGNORE --- //container_count: 0, --- IGNORE ---
containers: serde_json::to_value(&"")?, containers: serde_json::to_value(&"")?,

View File

@@ -160,7 +160,7 @@ pub struct ServerMessage {
// Define your message structure here // Define your message structure here
pub message_type: String, pub message_type: String,
pub data: serde_json::Value, pub data: serde_json::Value,
pub message_id: String, // Add an ID for acknowledgment pub message_id: String,
} }
/// Acknowledgment payload sent to the backend server for command messages. /// Acknowledgment payload sent to the backend server for command messages.
@@ -184,7 +184,7 @@ pub struct Acknowledgment {
/// - `Name`: Container name (string) /// - `Name`: Container name (string)
/// - `Status`: Container status ("running", "stopped", etc.) /// - `Status`: Container status ("running", "stopped", etc.)
#[derive(Debug, Serialize, Clone)] #[derive(Debug, Serialize, Clone)]
pub struct DockerRegistrationDto { pub struct DockerServiceDto {
/// Unique server identifier (integer) /// Unique server identifier (integer)
#[serde(rename = "Server_id")] #[serde(rename = "Server_id")]
pub server_id: u16, pub server_id: u16,

View File

@@ -1,20 +0,0 @@
networks:
watcher-network:
driver: bridge
services:
watcher:
image: git.triggermeelmo.com/watcher/watcher-server:v0.1.11
container_name: watcher
deploy:
resources:
limits:
memory: 200M
restart: unless-stopped
env_file: .env
ports:
- "5000:5000"
volumes:
- ./watcher-volumes/data:/app/persistence
- ./watcher-volumes/dumps:/app/wwwroot/downloads/sqlite
- ./watcher-volumes/logs:/app/logs