Skip to main content

CLI tool to enhance and simplify containerization of Minecraft servers

Project description

MinecraftDockerCLI

Set up your Minecraft network blazingly fast

license stars downloads Visitors open issues

MinecraftDockerCLI is a python CLI application to allow minecraft server admins to set up in a fast and easy way a server or a network using docker containers. MinecraftDockerCLI is orientated towards minecraft server admins that administrate networks, since a single server cannot fully use the advantages of Docker containers. Docker containers make minecraft networks easier and cleaner because of how docker containers work and intercomunicate on the same machine.

Installation

Prerequisites:

  • Docker Engine (Docker Desktop on Windows) running and configured.
  • Docker Compose (bundled with modern Docker Desktop installations).
  • Python 3.13+ and pip.

Recommended Installation:

# Create a Virtual Environment
python3 -m venv .venv
.\.venv\Scripts\Activate.ps1

# Install the python package
pip install MinecraftDockerCLI

Clone repo:

Extra requirement: Poetry.

# Clone the repository
git clone https://github.com/Dtar380/Minecraft-Dockerfile-CLI.git
cd Minecraft-Dockerfile-CLI

poetry install

[!NOTE] When running the program you would need to be using the poetry environment and run it like poetry run MinecraftDockerCLI

Usage

To use this app you simply need to type MinecraftDockerCLI in your terminal followed by the command you want to execute and the options you want to use.

[!WARNING] To ensure the app runs correctly, make sure the ENV you installed the app to is activated and that you are on the folder of your server project.

Universal Options

  • --no-confirm/-y: Disables confirmations via prompts and sets all confirmations to yes
  • --verbose/-v: Disables all console clears

Builder commands

Create:

  • Help: Create all files for the containerization.
  • Description: This command will ask the user with prompts everything to build a docker-compose.yml and .envs for all the services the user will run. Running this command on a existing project will overwrite the files.
  • Arguments:
    • --network: Parameter to specify the name of the network of the docker containers (required)

Update:

  • Help: Update the contents of the containers.
  • Description: This command will either delete a service or add a service with the same method as Create.
  • Arguments:
    • --add: Flag to state the addition of a new service.
    • --remove: Flag to state the removal of an existing service.
    • --change: Flag to state the change of an existing service.
    • --service: Parameter to specify the name of the service.

[!NOTE] For an update to take place containers must be restarted

Build:

  • Help: Build the files for the containerization.
  • Description: This command will build the files based on data.json in case they were not built when running create.

[!NOTE] None of the Builder commands will build nor start the containers.

Manager commands

Backup:

  • Help: Create a backup of the containers.
  • Description: This command will create a backup of every service in a tar file with the format {service_name}_{date}.tar.gz inside a .backup directory.

Up:

  • Help: Build the containers and start them. (This will overwrite the data inside with the host data)
  • Arguments:
    • --attached: Flag to run the containers in attached mode.
    • --detach-keys: Combination of keys to detach from the container terminal

Down:

  • Help: Stop the containers and delete them.
  • Arguments:
    • --rm-volumes: Flag to remove volumes.

[!WARNING] Running Up will overwrite the inside volumes of the container with host ones and down with --rm-files will remove the volumes inside the containers, make sure to create a backup and replace the files on host with the backups every time.

Start:

  • Help: Start the containers.

Stop:

  • Help: Stop the containers.

Open:

  • Help: Open the terminal of a service.
  • Arguments:
    • --service: Name of the service who's container terminal will be opened
    • --detach-keys: Combination of keys to detach from the container terminal

[!WARNING] If you attach to a container terminal and detach with ctrl+c this will stop the container.

Tips & Troubleshooting

  • Ensure Docker Desktop is running and you can run docker ps without errors before invoking the CLI.
  • On Windows, run PowerShell as Administrator or ensure your user has permissions for Docker.
  • If data.json is missing, run builder create first to scaffold services.

Working On

Currently resolving issues and developing the unit tests for future updates.

Already Planned releases

VERSION INCLUDES
1.0.0 First release (Add docs and do full tests)

Feel free to open Feature Requests issues to request things related to this concepts such popular IDE's, popular Git services with REST API's (API needed for being able to give support), unwanted types of files and folders generated by WorkSpace creations, etc.

Kown Issues

There is no known issues on the project, you can submit yours to issues.

License

This project is distributed under the MIT license. See the LICENSE.

Sponsorship

You can support me and the project with a donation to my Ko-Fi.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minecraftdockercli-0.6.0.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

minecraftdockercli-0.6.0-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file minecraftdockercli-0.6.0.tar.gz.

File metadata

  • Download URL: minecraftdockercli-0.6.0.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for minecraftdockercli-0.6.0.tar.gz
Algorithm Hash digest
SHA256 7b29f530f8e76e5e88568cad9ca550291184cc6ed0ec18d0d920e87b4668f722
MD5 79ff0317d3769a6d2bf79bc4144cfa1e
BLAKE2b-256 609a37a82cc7ae6daa5e09db5b9ec44e0c3818d9fd2760018853fe333d626747

See more details on using hashes here.

Provenance

The following attestation bundles were made for minecraftdockercli-0.6.0.tar.gz:

Publisher: publisher.yml on Dtar380/MinecraftDockerCLI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file minecraftdockercli-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for minecraftdockercli-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0efd351d5999bad5b497872692553cc90dd522c675280e91a9fbe884d8b82eb2
MD5 fde86a26a9122d7d9cd5e421b84d340a
BLAKE2b-256 b19b36126a8e3aff04092ca52776ca2a5ddc76ca7840406bb256ccaa26cf1e43

See more details on using hashes here.

Provenance

The following attestation bundles were made for minecraftdockercli-0.6.0-py3-none-any.whl:

Publisher: publisher.yml on Dtar380/MinecraftDockerCLI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page