https://github.com/sacconazzo/containerize-me
CLI to generate and manage Docker containers with docker compose
https://github.com/sacconazzo/containerize-me
cli container developer-tools docker docker-compose generator
Last synced: 3 months ago
JSON representation
CLI to generate and manage Docker containers with docker compose
- Host: GitHub
- URL: https://github.com/sacconazzo/containerize-me
- Owner: sacconazzo
- Created: 2025-12-25T10:05:14.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-12-26T13:00:41.000Z (6 months ago)
- Last Synced: 2025-12-27T23:45:31.174Z (6 months ago)
- Topics: cli, container, developer-tools, docker, docker-compose, generator
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# đŗ Container Manager CLI
Interactive CLI to generate and manage Docker containers with docker-compose dynamically.
## ⨠Features
- đ **Interactive menu** - Simple navigation with menu selection
- đī¸ **Organized categories** - Services organized by category (Database, Cache, Message Queue, etc.)
- âī¸ **Guided configuration** - Username, password, and ports with default values
- đž **Automatic persistent volumes** - Local data storage without manual configuration
- đ **Quick start** - Option to start the container immediately after configuration
- đĻ **Reusable compose files** - Generated docker-compose.yml files saved for future use
- âļī¸ **Manage existing services** - Start, stop, restart, and view logs of configured containers
## đ ī¸ Supported Services
### Database
- MongoDB
- PostgreSQL
- MySQL
- MariaDB
- Microsoft SQL Server (MSSQL)
### Cache
- Redis
- Memcached
### Message Queue
- RabbitMQ (with Management UI)
- Apache Kafka (with Zookeeper)
### Search Engine
- Elasticsearch
## đĻ Installation
1. Clone the repository or download the files
2. Create and activate a virtual environment (recommended):
**On macOS/Linux:**
```bash
# Create virtual environment
python3 -m venv .venv
# Activate virtual environment
source .venv/bin/activate
```
**On Windows:**
```bash
# Create virtual environment
python -m venv .venv
# Activate virtual environment
.venv\Scripts\activate
```
> đĄ To deactivate the virtual environment later, simply run `deactivate`
3. Install dependencies:
```bash
pip install -r requirements.txt
```
4. Make sure you have Docker and docker compose installed:
```bash
docker --version
docker compose version
```
## đ Usage
Run the CLI:
```bash
python cli.py
```
### Workflow
#### Configure New Service
1. **Select category** - Choose from Database, Cache, Message Queue, etc.
2. **Select service** - Choose the specific service (e.g., MongoDB, PostgreSQL)
3. **Configure parameters**:
- Username (with suggested default)
- Password (with suggested default)
- Database name (if applicable)
- Port (with suggested default)
4. **Automatic start** - Choose whether to start the container immediately or later
#### Manage Existing Services
From the main menu, select "Manage existing services" to:
- âļī¸ **Start** a previously configured container
- âšī¸ **Stop** a running container
- đ **Restart** a container
- đ **View logs** of a container
### Example
```
==================================================
đŗ Container Manager CLI
==================================================
? What do you want to do?
â Configure new service
âļī¸ Manage existing services
? Select a category: Database
? Select a service from Database: PostgreSQL
đ Configuration for PostgreSQL
==================================================
? Username (default: postgres): myuser
? Password (default: postgres): ********
? Database name (default: mydb): production_db
? Port (default: 5432): 5432
â
Configuration completed!
đĻ Service name: postgresql
đž Persistent volumes: /path/to/volumes/postgresql
? Do you want to start the container now? Yes
đ Starting container...
â
Container started successfully!
đ Compose file saved at: /path/to/compose-files/postgresql-compose.yml
```
## đ Directory Structure
After first use, the following will be created automatically:
```
.
âââ cli.py
âââ services.py
âââ requirements.txt
âââ volumes/ # Persistent volumes (created automatically)
â âââ mongodb/
â âââ postgresql/
â âââ ...
âââ compose-files/ # Generated docker-compose files (created automatically)
âââ mongodb-compose.yml
âââ postgresql-compose.yml
âââ ...
```
## đ¯ Container Management
### Using the CLI
The easiest way to manage your containers is through the CLI's built-in menu:
```bash
python cli.py
# Select "Manage existing services" from the main menu
```
This allows you to:
- Start, stop, and restart containers
- View logs
- All with an interactive menu
### Manual Commands
You can also use docker compose commands directly:
#### Start a container
```bash
docker compose -f compose-files/SERVICE-NAME-compose.yml up -d
```
### Stop a container
```bash
docker compose -f compose-files/SERVICE-NAME-compose.yml down
```
### View logs
```bash
docker compose -f compose-files/SERVICE-NAME-compose.yml logs -f
```
### Restart a container
```bash
docker compose -f compose-files/SERVICE-NAME-compose.yml restart
```
## đĄ Tips
- **Persistent volumes** are saved locally in the `volumes/` folder
- **Docker-compose files** are saved in `compose-files/` and can be reused
- **Ports** can be customized to avoid conflicts
- You can **configure multiple instances** of the same service with different ports
## đ§ Customization
To add new services, edit the [services.py](services.py) file and add the configuration to the `SERVICES_CATALOG` dictionary.
Example:
```python
"Database": {
"NewService": {
"image": "image:tag",
"default_user": "admin",
"default_password": "password",
"default_database": "mydb",
"default_port": 1234,
"has_database": True,
"env_vars": {
"ENV_VAR": "username"
},
"volume_path": "/data"
}
}
```
## đ License
MIT License - Feel free to use and modify as you wish!
## đ¤ Contributing
Contributions, issues, and feature requests are welcome!