lazyenv is a local environment management tool designed to improve developer experience by simplifying the setup and management of development environments. It provides utilities for configuring system settings, managing Docker containers for various services, and automating common development tasks.
The project is organized around three main areas:
- Config: System configuration files for SSH, WSL, and bash aliases
- Docker: Pre-configured Docker containers for popular services
- Scripts: Installation and utility scripts for common development tools
The project follows a modular architecture with the following key components:
lazyenv- Main executable script that serves as the command-line interfacelazyenv.config.example- Configuration template with version definitions and IP assignmentsMakefile- Contains common commands for environment managementconfig/- System configuration filesdocker/- Service-specific Docker configurationsscripts/- Installation and utility scripts
- Docker
- Bash-compatible shell
- curl (for some installation scripts)
-
Initialize configuration:
cp lazyenv.config.example lazyenv.config # Edit lazyenv.config with your specific paths and settings -
Create Docker network:
./lazyenv docker-net # Or using make: make create-net -
Install required tools:
./lazyenv install nvm ./lazyenv install docker-wsl # if on WSL -
Build and run Docker services:
./lazyenv docker-container-build postgres ./lazyenv docker-container-build redis # etc. for other services
./lazyenv help- Show available commands./lazyenv install {name}- Install tools by script name (e.g.,nvm,docker-wsl)./lazyenv run-util {name}- Run utility scripts./lazyenv docker-net- Create Docker network./lazyenv docker-container-ip {name}ordci {name}- Get container IP address./lazyenv docker-container-build {service}- Build service container./lazyenv docker-container-update {service}- Update service container./lazyenv pg-dump {db}- Create PostgreSQL database dump./lazyenv pg-restore {db} {file}- Restore PostgreSQL database./lazyenv psql-restore {db} {file}- Restore SQL file to PostgreSQL./lazyenv mongodump {db}- Create MongoDB dump./lazyenv mongorestore {db} {date}- Restore MongoDB database./lazyenv sync-dump- Copy dumps to pg_dump directory./lazyenv pg-list- List available dump files
make env-prepare- Initialize .env from examplemake create-net- Initialize Docker networksmake docker-container-ip container={name}- Check container IPmake docker-build-container name={name}- Build container by namemake docker-update-container name={name}- Update container by namemake postgres-dump db={database}- Create pg_dump by database namemake postgres-restore db={database} date={timestamp}- Restore pg databasemake mongodump db={database}- Create mongodump by database namemake mongorestore db={database} date={timestamp}- Restore mongo database
The project includes pre-configured Docker setups for:
- Consul
- Grafana
- Jaeger
- Kafka
- MongoDB
- NATS
- NGINX
- PostgreSQL
- RabbitMQ
- Redis
Each service has dedicated directories under docker/ with build and update scripts.
The lazyenv.config file contains:
- Project folder path
- Application version definitions (NVM, etc.)
- Docker image tags for all supported services
- Fixed IP addresses for Docker containers on the custom network
- Utility configurations for database dumps, DBeaver scripts, and GitHub repositories
- Shell scripts follow bash conventions
- Docker containers use fixed IP addresses on a custom bridge network (172.23.0.0/24)
- Each Docker service has its own directory with build/update scripts
- Configuration values are centralized in the config file for easy management
- The project uses a consistent naming convention for commands and variables
- Network Management: Creates a custom Docker network with fixed IP assignments for predictable service connectivity
- Database Utilities: Includes scripts for PostgreSQL and MongoDB backup/restore operations
- System Configuration: Provides configuration files for SSH, WSL, and bash aliases
- Service Management: Standardized approach to building and updating Docker containers
- Installation Scripts: Automated installation of common development tools
- Utility Functions: Helper scripts for common development tasks
# Set up the environment
cp lazyenv.config.example lazyenv.config
# Edit the config file with your settings
./lazyenv docker-net
# Install development tools
./lazyenv install nvm
# Build and run PostgreSQL container
./lazyenv docker-container-build postgres
# Check container IP
./lazyenv docker-container-ip postgres
# Create a database dump
./lazyenv pg-dump mydatabase
# List available dumps
./lazyenv pg-list