Skip to content

Ticket #15: Add docker-compose for Local Orchestration #55

Description

@PuneethM-06

Description

Define linux-sysmonitor as a Docker Compose service to simplify local deployment and orchestration. Configure environment variables, persistent storage for logs, and a restart policy. Optionally, add a second service to practice inter-container networking.


Tasks

  • Create a docker-compose.yml file in the project root.
  • Define the sysmonitor service using the local Dockerfile.
  • Configure a named volume to persist log files outside the container.
  • Mount the volume to the application's log directory (e.g., /app/logs).
  • Pass configuration using environment variables (e.g., LOG_LEVEL, CHECK_INTERVAL).
  • Add a restart policy:
    restart: unless-stopped
  • (Stretch Goal) Add a second service (e.g., nginx) and configure the health-check script to communicate with it using the Docker Compose network.
  • Start the application:
    docker compose up
  • Verify log persistence:
    docker compose down
    docker compose up
  • Confirm previously generated logs are still available.

Acceptance Criteria

  • docker compose up starts all configured services successfully.
  • The sysmonitor service runs without errors.
  • Log files persist across container restarts using the named volume.
  • Environment variables are correctly injected into the container.
  • (Stretch Goal) Services can communicate using the default Docker Compose network.

Commit Message

feat: add docker-compose for local orchestration (closes #15)

Why This Matters

Docker Compose is the standard tool for running multi-container applications during development. It introduces concepts that closely align with Kubernetes, including:

  • Service definitions
  • Named volumes
  • Environment variable injection
  • Container networking
  • Restart policies

Completing this ticket prepares you for Kubernetes fundamentals, where these concepts evolve into Pods, PersistentVolumeClaims (PVCs), ConfigMaps, and Services.

Interview Tip: Be prepared to explain why Docker Compose is ideal for local development but not sufficient for production. Common limitations include single-host deployment, limited scalability, and the absence of built-in orchestration features such as automatic scheduling, self-healing, and rolling updates.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions