mc-cluster/holesail-connector
2024-12-06 06:38:37 -05:00
..
Dockerfile first commit 2024-12-06 05:52:08 -05:00
pm2-setup.sh update 2024-12-06 06:38:37 -05:00
README.md update 2024-12-06 06:38:37 -05:00

Dockerized Holesail with PM2 Orchestration

This project provides a pre-configured Docker container for running multiple Holesail processes orchestrated using PM2. Each process is assigned a specific connection string and port.


Features

  • Ubuntu-based container: Uses the latest ubuntu image as the base.
  • Node.js v20: Includes the latest Node.js for running Holesail.
  • PM2 process management: Manages multiple Holesail processes with ease.
  • Multi-port configuration: Runs Holesail on multiple ports with predefined connection strings.

Getting Started

Prerequisites

  • Docker installed on your system.
  • Basic knowledge of Docker and PM2.

Build the Docker Image

  1. Clone this repository:

    git clone <repository_url>
    cd <repository_directory>
    
  2. Build the Docker image:

    docker build -t holesail-pm2 .
    

Run the Container

Start the container:

docker run -d --name holesail-pm2-container holesail-pm2

This will:

  • Install required dependencies.
  • Start multiple Holesail processes using PM2 based on predefined connection strings and ports.

Configuration

The pm2-setup.sh script defines the connection strings and ports. You can modify the connections array to suit your needs:

declare -A connections
connections=(
    ["<connection_string_1>"]=<port_1>
    ["<connection_string_2>"]=<port_2>
    ...
)

Logs and Debugging

To view PM2 logs from the container:

docker exec -it holesail-pm2-container pm2 logs

To inspect the container:

docker exec -it holesail-pm2-container bash

File Structure

.
├── Dockerfile           # Docker configuration for building the image
├── pm2-setup.sh         # PM2 setup script for launching Holesail processes

Extending

To add more features:

  1. Update the pm2-setup.sh file with additional PM2 configurations or commands.

  2. Rebuild the Docker image:

    docker build -t holesail-pm2 .
    

Notes

  • The pm2-runtime command ensures the container remains active as long as PM2 processes are running.
  • Ports and connection strings must not conflict with existing services.