Skip to content

Mini Data Center project using Docker, Docker Compose, and Azure VM,Hands-on project simulating a data center with Nginx, MySQL, Nextcloud, and Grafana

License

Notifications You must be signed in to change notification settings

Bharath6911/Mini-Data-Center-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mini Data Center Simulator using Docker & Azure

Overview

This project demonstrates how I built a Mini Data Center using Docker, Docker Compose, and an Azure Ubuntu VM.
The setup replicates the functionality of a small-scale datacenter with essential services:

  • Nginx (Web server)
  • MySQL (Database)
  • Nextcloud (File hosting platform)
  • Grafana (Monitoring and visualization)

The goal was to gain hands-on experience with datacenter concepts, containerization, networking, and cloud deployment, while also building a portfolio project.


Motivation

  • I underwent one month of training in the Data Center domain.
  • To apply what I learned, I explored containerization technologies such as Docker and Docker Compose.
  • I experimented with different configurations on Docker Desktop (Windows).
  • Some services failed to pull on Windows due to DNS/registry issues.
  • To solve this, I deployed the setup on a Linux VM in Azure, which provided a native and more stable environment.

This transition not only fixed issues but also gave me exposure to cloud infrastructure.


Prerequisite

  • Azure account or you can use personal laptop to work on least minimum hardware resourse also it will work
  • yaml file for docker-compose

Architecture

Below is the architecture diagram of the Mini Data Center setup:

Mini Data Center Architecture


Services

1. Nginx (Web Server)

  • Runs on port 8080.
  • Hosts static web content from the html folder.
  • Demonstrates how web servers deliver applications inside a datacenter.

Nginx

2. MySQL (Database)

  • Containerized MySQL 8 server.
  • Configured with root password, user, and application database.
  • Provides backend storage for applications like Nextcloud.

3. Nextcloud (File Hosting)

  • Runs on port 8081.
  • Provides cloud storage and collaboration platform.
  • Connected to MySQL database for persistent storage.
  • Simulates internal enterprise file sharing in a datacenter.

Nextcloud

4. Grafana (Monitoring)

  • Runs on port 3000.
  • Provides monitoring dashboards.
  • Can connect to multiple data sources (including MySQL).
  • Essential for observing system health and metrics.

Grafana


Docker Compose File

The entire setup is defined in a single docker-compose.yml file:

services:
  web:
    image: nginx:latest
    container_name: web-server
    ports:
      - "8080:80"
    volumes:
      - ./html:/usr/share/nginx/html:ro
    networks:
      - datacenter

  db:
    image: mysql:8
    container_name: mysql-db
    environment:
      MYSQL_ROOT_PASSWORD: rootpass
      MYSQL_DATABASE: appdb
      MYSQL_USER: appuser
      MYSQL_PASSWORD: apppass
    volumes:
      - db_data:/var/lib/mysql
    networks:
      - datacenter

  file:
    image: nextcloud
    container_name: nextcloud
    ports:
      - "8081:80"
    volumes:
      - nextcloud_data:/var/www/html
    networks:
      - datacenter
    depends_on:
      - db

  grafana:
    image: grafana/grafana
    container_name: grafana
    ports:
      - "3000:3000"
    environment:
      - GF_SECURITY_ADMIN_USER=admin
      - GF_SECURITY_ADMIN_PASSWORD=admin
    networks:
      - datacenter

volumes:
  db_data:
  nextcloud_data:

networks:
  datacenter:
    driver: bridge

Steps to Deploy

  1. Provision an Azure VM

    • Create Ubuntu Server VM on Azure.
    • Assign a public IP.
    • SSH into the VM.
  2. Install Docker & Docker Compose

    sudo apt update
    sudo apt install -y docker.io docker-compose
    sudo systemctl enable docker
  3. Copy project files

    • Upload docker-compose.yml and html/ directory to VM.
  4. Run the project

    docker-compose up -d
  5. Configure Firewall (UFW)

    sudo ufw allow 8080
    sudo ufw allow 8081
    sudo ufw allow 3000
    sudo ufw enable
  6. Access Services

    • http://<vm-ip>:8080 → Nginx
    • http://<vm-ip>:8081 → Nextcloud
    • http://<vm-ip>:3000 → Grafana

Conclusion

This project replicates the foundation of a real datacenter environment.
I have successfully demonstrated skills in containerization, networking, databases, cloud hosting, and monitoring.
Perfect as both a learning exercise and a portfolio project to showcase applied DevOps and datacenter knowledge.

About

Mini Data Center project using Docker, Docker Compose, and Azure VM,Hands-on project simulating a data center with Nginx, MySQL, Nextcloud, and Grafana

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages