Docker_Containers

Docker, Docker Compose, MySQL, MariaDB, phpMyAdmin, Pi-hole, Portainer, PostgreSQL, Prometheus, Grafana, GoSpeed, Watchtower, Container Management, Monitoring, Database Management.

MIT License

Stars
2
Committers
2

Docker and Docker Compose Documentation

This repository provides pre-configured Docker Compose setups for various essential services, including GoSpeed, MySQL with MariaDB and phpMyAdmin, Pi-hole, Portainer, PostgreSQL, and a monitoring stack featuring Prometheus and Grafana.

Table of Contents

  1. Installing Docker and Docker Compose
  2. Post-Installation Steps
  3. Repository Structure
  4. Setup Overviews
  5. Usage Instructions
  6. Dependency Management with Renovate
  7. Contributing & Support
  8. License

Installing Docker and Docker Compose

Windows

  1. Download Docker Desktop from Docker Hub.
  2. Run the Installer and follow the instructions.
  3. Verify Installation:
    docker --version  # Check the installed Docker version
    docker-compose --version  # Check the installed Docker Compose version
    

macOS

  1. Download Docker Desktop from Docker Hub.
  2. Open the .dmg file and drag Docker to Applications.
  3. Verify Installation:
    docker --version  # Check the installed Docker version
    docker-compose --version  # Check the installed Docker Compose version
    

Ubuntu

  1. Remove Old Versions:
    sudo apt remove docker docker-engine docker.io containerd runc  # Clean up old installations
    
  2. Install Required Packages:
    sudo apt update  # Update package list
    sudo apt install apt-transport-https ca-certificates curl software-properties-common  # Install prerequisites
    
  3. Add Docker’s GPG Key and Repository:
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -  # Add Docker’s GPG key
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"  # Add Docker repository
    
  4. Install Docker and Docker Compose:
    sudo apt update  # Update package list again
    sudo apt install docker-ce docker-compose  # Install Docker and Docker Compose
    

CentOS

  1. Remove Old Versions:
    sudo yum remove docker docker-common docker-selinux docker-engine  # Clean up old installations
    
  2. Set up the Stable Repository:
    sudo yum install -y yum-utils  # Install required utilities
    sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo  # Add Docker repository
    
  3. Install Docker:
    sudo yum install docker-ce  # Install Docker
    sudo systemctl start docker  # Start Docker service
    sudo systemctl enable docker  # Enable Docker to start on boot
    
  4. Install Docker Compose:
    sudo yum install docker-compose  # Install Docker Compose via package manager
    

openSUSE

  1. Remove Old Versions:
    sudo zypper rm docker docker-engine docker-selinux  # Clean up old installations
    
  2. Install Docker:
    sudo zypper install docker  # Install Docker
    
  3. Start Docker:
    sudo systemctl start docker  # Start Docker service
    sudo systemctl enable docker  # Enable Docker to start on boot
    
  4. Install Docker Compose:
    sudo zypper install docker-compose  # Install Docker Compose via package manager
    

Additional Platforms

For installation on other distributions (Debian, Fedora, Arch Linux, etc.), please refer to the official Docker documentation.

Post-Installation Steps

  1. Manage Docker as a Non-Root User:

    sudo usermod -aG docker $USER  # Add current user to the Docker group for non-root access
    

    Log out and back in for changes to take effect.

  2. Verify Docker Installation:

    docker run hello-world  # Run a test container to verify installation
    
  3. Configure Docker to Start on Boot:

    sudo systemctl enable docker  # Set Docker to start automatically on boot
    
  4. Check Docker Service Status:

    sudo systemctl status docker  # Check if Docker service is running
    
  5. Explore Docker Commands:

    docker --help  # Display available Docker commands
    docker ps  # List running containers
    docker ps -a  # List all containers, including stopped ones
    
  6. Security Practices: Review Docker security best practices to protect your environment.

  7. Regular Maintenance: Keep Docker updated with your package manager to ensure you have the latest features and security patches.

Repository Structure

This repository is organized as follows:

.
├── gospeed
│   └── docker-compose.yml
├── mysql-mariadb-phpmyadmin-setup
│   └── docker-compose.yml
├── pihole-setup
│   └── docker-compose.yml
├── portainer-setup
│   └── docker-compose.yml
├── postgresql-setup
│   └── docker-compose.yml
├── prometheus-grafana-setup
│   ├── docker-compose.yml
│   └── prometheus
│       └── prometheus.yml
├── README.md
└── renovate.json

Setup Overviews

GoSpeed Setup

Directory: gospeed/

  • Deploy GoSpeed.
  • Access UI at http://localhost:9999.

MySQL, MariaDB & phpMyAdmin Setup

Directory: mysql-mariadb-phpmyadmin-setup/

  • Set up MySQL and MariaDB with phpMyAdmin.
  • Access phpMyAdmin at http://localhost:8080.

Pi-hole Setup

Directory: pihole-setup/

  • Deploy Pi-hole for ad blocking.
  • Access web interface at http://localhost.

Portainer Setup

Directory: portainer-setup/

  • Manage Docker containers using Portainer.
  • Access Portainer at http://localhost:9000.

PostgreSQL Setup

Directory: postgresql-setup/

  • Set up a PostgreSQL database.
  • Access PostgreSQL on port 5432.

Prometheus & Grafana Monitoring Stack

Directory: prometheus-grafana-setup/

  • Monitor systems with Prometheus and Grafana.
  • Access Prometheus at http://localhost:7070 and Grafana at http://localhost:7071.

Usage Instructions

  1. Choose a Service Directory: Navigate to the desired service directory.
  2. Customize Configurations: Edit docker-compose.yml as needed.
  3. Deploy the Service:
    docker-compose up -d  # Start services in detached mode
    
  4. Stop the Service:
    docker-compose down  # Stop and remove the containers
    

Dependency Management with Renovate

This repository uses Renovate to automatically update Docker images and dependencies. The configuration is defined in renovate.json.

Contributing & Support

Contributions are welcome! For suggestions or issues, please open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Related Projects