A reproducible Infrastructure as Code (IaC) solution that runs Docker containers inside VirtualBox using Vagrant for consistent development environments.
This project provides a fully reproducible infrastructure stack:
- Host Machine: Your Linux system with VirtualBox
- Virtual Machine: Ubuntu 22.04 LTS managed by Vagrant
- Containers: Docker containers running your application stack
- Automation: Makefile commands for easy management
- VirtualBox: For virtualization (uses your OS installation)
- Vagrant: For VM provisioning (auto-installed by setup script)
- Git: For version control
- RAM: 8GB+ recommended (VM uses 4GB)
- Disk Space: 20GB+ free space
- CPU: 2+ cores recommended
git clone <your-repo-url>
cd Inception
make setup # Validates infrastructure requirementsmake vm-up # Creates and starts VirtualBox VM
make vm-ssh # Connect to the VM# Inside the VM
cd /home/vagrant/inception
cp .env.template .env # Edit as needed
make build # Build Docker images
make up # Start containers- Web: http://localhost:8080
- HTTPS: https://localhost:8443
- Database: localhost:3306
| Command | Description |
|---|---|
make setup |
Validate and setup infrastructure requirements |
make vm-up |
Start and provision the VirtualBox VM |
make vm-down |
Stop the VirtualBox VM |
make vm-ssh |
SSH into the VirtualBox VM |
make vm-status |
Show VM status |
make vm-destroy |
Destroy the VM completely |
make vm-provision |
Re-run VM provisioning |
make vm-info |
Show VM connection information |
| Command | Description |
|---|---|
make build |
Build Docker containers |
make up |
Start Docker containers |
make down |
Stop Docker containers |
make logs |
Show container logs |
make clean |
Clean containers and images |
make fclean |
Full clean (includes VM destruction) |
make re |
Rebuild everything from scratch |
| Command | Description |
|---|---|
make deploy |
Deploy full stack (VM + containers) |
make dev-shell |
Open development shell in VM |
Inception/
βββ Vagrantfile # VirtualBox VM configuration
βββ setup-infra.sh # Infrastructure validation script
βββ Makefile # Automation commands
βββ README.md # This file
βββ srcs/ # Docker application source
βββ docker-compose.yml # Container orchestration
βββ .env.template # Environment variables template
βββ requirements/ # Docker build contexts
βββ nginx/ # Web server container
βββ wordpress/ # Application container
βββ mariadb/ # Database container
Copy and customize the environment file:
cp srcs/.env.template srcs/.env
# Edit srcs/.env with your specific configurationThe VirtualBox VM is configured with:
- OS: Ubuntu 22.04 LTS
- RAM: 4GB
- CPUs: 2 cores
- Network: Private network (192.168.56.10)
- Ports: 80β8080, 443β8443, 3306β3306
Persistent data is stored in:
/home/vagrant/inception/data/wordpress- WordPress files/home/vagrant/inception/data/mariadb- Database files
- Vagrantfile: Defines VM configuration
- Provisioning Scripts: Automated software installation
- Docker Compose: Container orchestration
- Environment Templates: Consistent configuration
- All configuration files are committed to Git
- No manual setup steps required
- Consistent environments across team members
- Easy rollback to previous configurations
- Complete isolation from host system
- No Docker installation required on host
- No port conflicts with host services
- Easy cleanup and reset
# Check VM status
make vm-status
# Restart VM
make vm-down && make vm-up
# Re-provision VM
make vm-provision
# Complete reset
make vm-destroy && make vm-up# Inside VM - restart containers
make down && make up
# Rebuild containers
make clean && make build && make up
# Check logs
make logs# Check VM network
vagrant ssh -c "ip addr show"
# Test port forwarding
curl http://localhost:8080- Change default passwords in
.envfile - Use proper SSL certificates for production
- Restrict VM network access as needed
- Keep VirtualBox and Vagrant updated
- Make infrastructure changes in appropriate files
- Test with
make vm-destroy && make deploy - Update documentation as needed
- Commit all configuration files