Bagel Server is a containerized development environment designed for the Bagel project, an infrastructure management and deployment platform similar to Env0. This Docker image provides a complete development toolkit with all the necessary tools for working with infrastructure as code, cloud providers, and modern web development.
Bagel is a comprehensive infrastructure management platform that enables developers and DevOps teams to:
- Manage Terraform deployments
- Connect with cloud providers (AWS, etc.)
- Handle GitHub integrations and repositories
- Streamline infrastructure provisioning workflows
This containerized environment includes:
- Git - Version control system for managing Bagel's codebase
- Node.js (v20.x) - JavaScript runtime for the Bagel frontend and backend services
- Terraform (v1.6.2) - Infrastructure as code tool for deployment management
- AWS CLI (v2.13.25) - Command line interface for AWS cloud operations
- Workspace folder - Pre-configured development workspace at
/workspace
To build the Docker image locally, run:
docker build -t bagel-server:latest .If the image is published to Docker Hub, you can pull it directly:
# Replace 'yourusername' with the actual Docker Hub username
docker pull yourusername/bagel-server:latest# Run interactively with bash shell
docker run -it --rm bagel-server:latest
# Run with volume mount to share files
docker run -it --rm -v ${PWD}:/workspace/project bagel-server:latest# Start the container
docker-compose up -d
# Access the container shell
docker-compose exec dev-environment bash
# Stop the container
docker-compose downOnce inside the container, you can verify all tools are installed:
git --version
node --version
npm --version
terraform version
aws --version# Clone the Bagel project
git clone <bagel-repository-url>
cd bagel-project
# Install frontend dependencies
cd env0-lite-frontend
npm install
# Install backend dependencies
cd ../bagel-server
npm install
# Run development servers
npm run dev# Configure AWS credentials for cloud provider integration
aws configure
# Test AWS connectivity (used by Bagel for deployments)
aws s3 ls
aws sts get-caller-identity# Initialize Terraform (as used by Bagel's deployment engine)
terraform init
# Validate Terraform configurations
terraform validate
# Plan infrastructure changes (Bagel's deployment preview)
terraform plan
# Apply infrastructure (Bagel's deployment execution)
terraform apply# Operations that Bagel performs with connected GitHub repos
git clone <repository-url>
git status
git add .
git commit -m "Infrastructure updates via Bagel"
git push origin mainYou can set environment variables when running the container:
docker run -it --rm \
-e AWS_REGION=us-west-2 \
-e AWS_PROFILE=default \
-v ${PWD}:/workspace/project \
bagel-server:latestCommon volume mounts you might want to use:
- Project files:
-v ${PWD}:/workspace/project - AWS credentials:
-v ~/.aws:/root/.aws:ro - Git configuration:
-v ~/.gitconfig:/root/.gitconfig:ro - SSH keys:
-v ~/.ssh:/root/.ssh:ro
If you encounter permission issues with mounted volumes, you may need to adjust file permissions or run the container with specific user permissions.
Make sure to configure your AWS credentials either by:
- Mounting your
~/.awsdirectory - Using environment variables
- Using IAM roles if running in AWS
You can customize this image by:
- Modifying the
Dockerfileto add additional tools - Updating version numbers for the installed packages
- Adding custom scripts or configurations
The repository includes a GitHub Actions workflow that automatically builds and pushes the Docker image to Docker Hub whenever code is pushed to the main branch.
Setup Required:
- Go to your GitHub repository settings โ Secrets and variables โ Actions
- Add the following secrets:
DOCKER_USERNAME: Your Docker Hub usernameDOCKER_PASSWORD: Your Docker Hub password or access token
The workflow will automatically:
- Build the Docker image for multiple platforms (AMD64 and ARM64)
- Push to Docker Hub with appropriate tags
- Update the Docker Hub repository description
- Use caching for faster builds
To share the Bagel development environment manually:
# Login to Docker Hub
docker login
# Push using the PowerShell script
.\build.ps1 push -DockerHubUsername yourusername# Tag for Docker Hub
docker tag bagel-server:latest yourusername/bagel-server:latest
# Push to Docker Hub
docker push yourusername/bagel-server:latestFor detailed deployment instructions, see DEPLOYMENT_GUIDE.md.
Once published, team members can quickly set up the Bagel development environment:
# Pull and run the Bagel dev environment
docker pull yourusername/bagel-server:latest
docker run -it --rm -v ${PWD}:/workspace/project yourusername/bagel-server:latest
# Or use in docker-compose.yml for Bagel development
services:
bagel-dev:
image: yourusername/bagel-server:latest
volumes:
- .:/workspace/project
- ~/.aws:/root/.aws:ro # For AWS integration testing
environment:
- AWS_REGION=us-east-1This development environment is specifically configured for contributing to the Bagel project. It includes all necessary tools for:
- Frontend development (Next.js, React, TypeScript)
- Backend development (Node.js, Express, MongoDB)
- Infrastructure management (Terraform, AWS CLI)
- Version control and collaboration (Git, GitHub integration)